-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Labels
area:metaprogramming:quotesIssues related to quotes and splicesIssues related to quotes and splicesitype:bugregressionThis worked in a previous version but doesn't anymoreThis worked in a previous version but doesn't anymore
Milestone
Description
Compiler version
OK
- 3.2.2
- 3.3.0
- 3.3.1-RC1-bin-20230321-d36cd2d-NIGHTLY
NG
- 3.3.1-RC1-bin-20230322-1f574e8-NIGHTLY
- 3.3.1-RC1
- 3.3.1-RC1-bin-20230524-5262680-NIGHTLY
Minimized code
A.scala
package example
import scala.quoted.Expr
import scala.quoted.Quotes
object A {
inline def f(inline a: Any): Boolean = ${ impl('a) }
def impl(a: Expr[Any])(using Quotes): Expr[Boolean] = {
a match {
case '{ new String($x: Array[Byte]) } =>
'{ true }
case _ =>
'{ false }
}
}
}
Main.scala
package example
object Main {
def main(args: Array[String]): Unit = {
val x = A.f(new String(Array.empty[Byte]))
println(x)
}
}
Output
false
Expectation
print true
Note
Metadata
Metadata
Assignees
Labels
area:metaprogramming:quotesIssues related to quotes and splicesIssues related to quotes and splicesitype:bugregressionThis worked in a previous version but doesn't anymoreThis worked in a previous version but doesn't anymore