We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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)
It prints /home/adpi2/test/src/main/scala/App.scala:<81..88> which corresponds to Some(1)
/home/adpi2/test/src/main/scala/App.scala:<81..88>
Some(1)
The position should contain Some(1).foo
Some(1).foo
The text was updated successfully, but these errors were encountered:
Fix scala#10011: Set missing span of extension selection
deebffc
915fffa
Merge pull request #10024 from dotty-staging/fix-10011
972ae73
Fix #10011: Set missing span of extension selection
Successfully merging a pull request may close this issue.
Uh oh!
There was an error while loading. Please reload this page.
Minimized code
I have a macro method that prints the location of the expression that is passed to it:
Then I can pass a call to an extension method to it:
Output
It prints
/home/adpi2/test/src/main/scala/App.scala:<81..88>
which corresponds toSome(1)
Expectation
The position should contain
Some(1).foo
The text was updated successfully, but these errors were encountered: