Closed
Description
Minimization:
import scala.quoted.* trait C: type T def foo: T inline def makro(inline x: C): x.T = ${ impl[x.type]('x) } def impl[CC <: C](xp: Expr[CC])(using Quotes): Expr[CC#T] = '{ $xp.foo }-- Error: Test.scala:5:45 ------------------------------------------------------ 5 |inline def makro(inline x: C): x.T = ${ impl[x.type]('x) } | ^ | access to parameter x from wrong staging level: | - the definition is at level 0, | - but the access is at level -1. -- Error: Test.scala:5:53 ------------------------------------------------------ 5 |inline def makro(inline x: C): x.T = ${ impl[x.type]('x) } | ^ | access to parameter x from wrong staging level: | - the definition is at level 0, | - but the access is at level -1.
(only the first error shows if the
[x.type]
argument left to inference)Originally posted by @lrytz in sirthias/parboiled2#274 (comment)