Skip to content

Commit 512f67a

Browse files
committed
Mark or unname unused parameters; scala 3 -> 3.3.7
1 parent 6f6484d commit 512f67a

File tree

8 files changed

+17
-14
lines changed

8 files changed

+17
-14
lines changed

Base/src/main/scala-3/typeclass/RepeatedImpl.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ object RepeatedImpl {
143143
private[typeclass]
144144
def quotedToExprList[A](using TypeCreator[A]):BiRepeated[Quotes, Expr, Expr[A], Expr[List[A]]] = {
145145
BiRepeated.apply[Quotes, Expr, Expr[A], Builder[Expr[A], List[Expr[A]]], Expr[List[A]]](
146-
(ctx) => List.newBuilder[Expr[A]],
147-
(acc, elem, ctx) => {acc += elem},
146+
(_) => List.newBuilder[Expr[A]],
147+
(acc, elem, _) => {acc += elem},
148148
(acc, ctx) => {
149149
given Quotes = ctx
150150
@nowarn("id=E198") given Type[A] = TypeCreator[A].createType

Base/src/main/scala/typeclass/Eithered.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ object Eithered extends LowPrioEithered {
136136
*/
137137
@ifdef("scalaBinaryVersion:3")
138138
def quotedSplicePiece[A]: Eithered[scala.quoted.Quotes, scala.quoted.Expr[A], scala.quoted.Expr[Iterable[A]], Repeated.SplicePiece[scala.quoted.Expr, A]] =
139-
Eithered((value, ctx) => new Repeated.SplicePiece.One(value), (value, ctx) => new Repeated.SplicePiece.Many(value))
139+
Eithered((value, _) => new Repeated.SplicePiece.One(value), (value, _) => new Repeated.SplicePiece.Many(value))
140140

141141
/**
142142
* An Eithered that wraps the value in a `scala.Either`
@@ -349,8 +349,8 @@ private[typeclass] trait LowPrioBiEithered {
349349
@ifdef("scalaBinaryVersion:3")
350350
implicit def quotedSymmetric[A]:BiEithered[scala.quoted.Quotes, scala.quoted.Expr, A, A, A] = {
351351
BiEithered.apply[scala.quoted.Quotes, scala.quoted.Expr, A, A, A](
352-
(value, ctx) => value,
353-
(value, ctx) => value,
352+
(value, _) => value,
353+
(value, _) => value,
354354
PartialExprFunction.identity,
355355
PartialExprFunction.identity,
356356
)
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package name.rayrobdod.stringContextParserCombinator
22

3+
import scala.annotation.unused
4+
35
object PointerSpacesCompat {
4-
inline def apply(v2:Int, v3:Int) = (" " * v3) + "^"
6+
inline def apply(@unused v2:Int, v3:Int) = (" " * v3) + "^"
57
}

TimeParser/src/test/scala-3/ExtractorMacroErrorMessageCompat.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package name.rayrobdod.stringContextParserCombinatorExample.datetimeTest
22

3+
import scala.annotation.unused
4+
35
object ExtractorMacroErrorMessageCompat {
4-
def apply(methodName:String, expectingLine:String, contextLine:String, pointerLine:String):String = {
6+
def apply(methodName:String, expectingLine:String, contextLine:String, @unused pointerLine:String):String = {
57
s"""|error:
68
|value $methodName is not a member of StringContext.
79
|An extension method was tried, but could not be fully constructed:

UriParser/src/main/scala-3/MacroImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ object MacroImpl {
242242
}
243243

244244
private def absoluteUri:Interpolator[Expr[URI]] = {(
245-
(scheme <~ isString(":")).flatMap: (scheme:Expr[String], ctx1:Quotes) =>
245+
(scheme <~ isString(":")).flatMap: (scheme:Expr[String], _:Quotes) =>
246246
(isString("//") ~>
247247
server <~>
248248
absolutePathExpr.optionally().map(_.getOrElse(nullExpr)) <~>

XmlParser/src/main/scala/XmlParser.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,18 +353,16 @@ private[xml] object XmlParser {
353353

354354
def interpolate[Z](sc:Expr[scala.StringContext], args:Expr[Seq[Any]], factory:Expr[XmlFactory[Z]])(using Type[Z], Quotes):Expr[Z] = {
355355
import quotes.reflect.*
356-
val (factoryExpr, factoryType) = factory match {case '{ $x: t } => ((x, Type.of[t])) }
357-
358356
val initialNsb:NamespaceBinding = Map(
359357
(None, ""),
360358
(Some("xml"), "http://www.w3.org/XML/1998/namespace"),
361359
(Some("xmlns"), "http://www.w3.org/200/xmlns/")
362360
)
363361

364-
factoryExpr.asTerm
362+
factory.asTerm
365363
.selectAndApplyToArgsMaybeDynamicMaybeVarargs
366364
("literal")
367-
((fragment(factoryExpr, initialNsb) <~> end).interpolate(sc, args).map(_.asTerm))
365+
((fragment(factory, initialNsb) <~> end).interpolate(sc, args).map(_.asTerm))
368366
.asExprOf[Z]
369367
}
370368

XmlParser/src/test/scala/MinixmlFactoryTest.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package name.rayrobdod.stringContextParserCombinatorExample.xml
22

3+
import scala.annotation.unused
34
import scala.language.dynamics
45

56
package minixml:
@@ -60,7 +61,7 @@ object MinixmlFactory extends XmlFactory[minixml.Elem]:
6061
def selectDynamic(uri:String):Namespaced =
6162
new Namespaced(uri)
6263

63-
def applyDynamic(uri: String)(prefix:String):Namespaced =
64+
def applyDynamic(uri: String)(@unused prefix:String):Namespaced =
6465
new Namespaced(uri)
6566

6667
final class MiniXmlFactoryTest extends munit.FunSuite {

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
val scala212Ver = "2.12.20"
22
val scala213Ver = "2.13.16"
3-
val scala3Ver = "3.3.6"
3+
val scala3Ver = "3.3.7"
44

55
val githubId = "rayrobdod/string-context-parser-combinator"
66

0 commit comments

Comments
 (0)