Skip to content

Commit 8aceae0

Browse files
committed
Resolve Scala 3 compilation warnings
1 parent ef15c39 commit 8aceae0

File tree

6 files changed

+13
-14
lines changed

6 files changed

+13
-14
lines changed

library/coreGeneric/src/main/scala-3/japgolly/scalajs/react/ReusabilityMacros.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,19 @@ object ReusabilityMacros {
146146
)(using Quotes, Type[A]): Expr[Reusability[A]] = {
147147
import quotes.reflect.*
148148

149-
val logNonReuse = _logNonReuse.valueOrError
150-
val logCode = _logCode .valueOrError
151-
val compareRefs = _compareRefs.valueOrError
149+
val logNonReuse = _logNonReuse.valueOrAbort
150+
val logCode = _logCode .valueOrAbort
151+
val compareRefs = _compareRefs.valueOrAbort
152152

153153
val fieldExclusions = {
154154
var l: List[String] =
155155
if _excludeFields == null
156156
then Nil
157-
else _excludeFields.valueOrError.split(',').iterator.map(_.trim).filter(_.nonEmpty).toList
157+
else _excludeFields.valueOrAbort.split(',').iterator.map(_.trim).filter(_.nonEmpty).toList
158158
if _except1 != null then
159-
l ::= _except1.valueOrError
159+
l ::= _except1.valueOrAbort
160160
if _exceptN != null then
161-
l :::= _exceptN.valueOrError.toList
161+
l :::= _exceptN.valueOrAbort.toList
162162
FieldExclusions.fromList(l)
163163
}
164164

library/coreGeneric/src/main/scala-3/japgolly/scalajs/react/component/builder/ComponentBuilderMacros.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ object ComponentBuilderMacros {
196196
val backendClass = TypeRepr.of[B].typeSymbol
197197

198198
val renderMethod: Symbol = {
199-
var candidates = backendClass.memberMethod("render")
200-
backendClass.memberField("render") match {
199+
var candidates = backendClass.methodMember("render")
200+
backendClass.fieldMember("render") match {
201201
case f if !f.isNoSymbol => candidates ::= f
202202
case _ =>
203203
}

library/coreGeneric/src/main/scala-3/japgolly/scalajs/react/internal/CompileTimeConfig.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ object CompileTimeConfig {
2222
def getModule[A: Type](key: Expr[String])(using Quotes): Option[Expr[A]] = {
2323
import quotes.reflect.*
2424
val value: Option[String] =
25-
CompileTimeInfo.quoted.sysPropOrEnvVar(key).valueOrError
25+
CompileTimeInfo.quoted.sysPropOrEnvVar(key).valueOrAbort
2626
value.map(fqcn => loadModuleOrError[A](Expr.inlineConst(fqcn)))
2727
}
2828

@@ -32,7 +32,7 @@ object CompileTimeConfig {
3232
}
3333

3434
def loadModuleOrError[A: Type](fqcnExpr: Expr[String])(using Quotes): Expr[A] = {
35-
val fqcn = fqcnExpr.valueOrError
35+
val fqcn = fqcnExpr.valueOrAbort
3636
loadModule(fqcn) match {
3737
case Right(e) => e
3838
case Left(e) => fail(s"$fqcn $e")

library/coreGeneric/src/main/scala-3/japgolly/scalajs/react/internal/ScalaJsReactConfigProxy.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ object ScalaJsReactConfigProxy {
4444
args.map(_._2)
4545

4646
var candidateSyms =
47-
moduleSym.memberMethod(methodName)
47+
moduleSym.methodMember(methodName)
4848

4949
if (args.isEmpty) {
50-
val f = moduleSym.memberField(methodName)
50+
val f = moduleSym.fieldMember(methodName)
5151
if (!f.isNoSymbol)
5252
candidateSyms ::= f
5353
}

library/coreGeneric/src/main/scala-3/japgolly/scalajs/react/vdom/CssUnits.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ object CssUnits {
1414
n.asTerm match {
1515
case Inlined(_, _, Literal(c)) =>
1616
val v = c.value
17-
val s = if v == 0 then "0" else v.toString + suffix.valueOrError
17+
val s = if v == 0 then "0" else v.toString + suffix.valueOrAbort
1818
Expr.inlineConst(s)
1919

2020
case _ =>

library/tests/src/test/scala/japgolly/scalajs/react/core/ReusabilityTest.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ object ReusabilityTest extends TestSuite {
145145
private class DerivesByRef {
146146
class X
147147
implicit val x: Reusability[X] = Reusability.never
148-
val _ = x
149148
case class Y(x: X)
150149
implicit val y: Reusability[Y] = Reusability.derive[Y]
151150
val y1 = Y(new X)

0 commit comments

Comments
 (0)