Closed
Description
Minimized code
I have a macro method that prints the location of the expression that is passed to it:
inline def printPos[T](inline expr: T): Unit =
${ printPos('expr) }
private def printPos[T](expr: Expr[T])(using QuoteContext): Expr[Unit] =
'{ println( ${Expr(expr.unseal.pos.toString) } ) }
Then I can pass a call to an extension method to it:
extension [T](a: T) def foo: Any = ???
@main def Test = printPos(Some(1).foo)
Output
It prints /home/adpi2/test/src/main/scala/App.scala:<81..88>
which corresponds to Some(1)
Expectation
The position should contain Some(1).foo