Closed
Description
Compiler version
3.2.1-RC1-bin-20220719-56e9a93-NIGHTLY and earlier
Minimized code
//> using scala "3.2.1-RC1-bin-20220719-56e9a93-NIGHTLY"
import quoted.*
inline def foo(s: Singleton): Unit = ${ fooImpl('s) }
def fooImpl(s: Expr[Singleton])(using Quotes) = '{}
Output
[error] QuotedSingleton.scala:5:49: access to parameter s from wrong staging level:
[error] - the definition is at level 0,
[error] - but the access is at level -1.
[error] inline def foo(s: Singleton): Unit = ${ fooImpl('s) }
[error] ^
Expectation
This should compile without error. The problem occurs also for unions of Singleton
with other types.