-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed as not planned
Labels
area:metaprogramming:quotesIssues related to quotes and splicesIssues related to quotes and splicesitype:bug
Description
Compiler version
3.1.3 and earlier ones
Minimized code
Macro.scala
//> using scala "3.1.3"
import scala.quoted.*
object OpaqueScope:
opaque type MyInt[A] = Int
export OpaqueScope.MyInt
inline def foo() = ${ fooImpl }
def fooImpl(using Quotes) =
Type.of[MyInt[String]] match
case '[MyInt[a]] => '{}MacroTest.scala
def bar = foo()Output
[error] ./MacroTest.scala:1:11: Exception occurred while executing macro expansion.
[error] scala.MatchError: Type.of[...] (of class scala.quoted.runtime.impl.TypeImpl)
[error] at Macro$package$.fooImpl(Macro.scala:14)
[error]
[error] def bar = foo()
[error] ^^^Expectation
The pattern match should succeed, just as it does if one of the changes below is made:
MyIntis declared as a trait or a non-opaque type alias instead of an opaque type alias- the concrete type
'[MyInt[String]]is used in the match pattern instead of'[MyInt[a]]with a type variable
Metadata
Metadata
Assignees
Labels
area:metaprogramming:quotesIssues related to quotes and splicesIssues related to quotes and splicesitype:bug