Closed
Description
Compiler version
3.1.1
Minimized code
import scala.quoted.*
given staging.Compiler = staging.Compiler.make(getClass.getClassLoader)
def underlyingArgumentImpl[A](expr: Expr[A])(using Quotes, Type[A]) =
import scala.quoted.quotes.reflect.*
expr.asTerm.underlyingArgument.asExprOf[A]
inline def underlyingArgument[A](inline a: A): A = ${
underlyingArgumentImpl('a)
}
val b: Boolean = staging.run[Boolean] {
'{
def f() = {
enum E:
case V
underlyingArgument(E.V == E.V)
}
f()
}
}
println(b)
https://scastie.scala-lang.org/82665kkpQ3KIBESu0jMnTg
Output
false
Expectation
true