We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
8246a7b
macros.scala:
macros.scala
import scala.quoted.{Quotes, Expr, quotes} inline def assertTrue(cond: Boolean) = ${ assertTrueImpl('cond) } def assertTrueImpl(cond: Expr[Boolean])(using Quotes) = '{ if (!$cond) throw new Error(${'{""}}) }
Test.scala:
Test.scala
object Test: def main(args: Array[String]) = try assertTrue(1 == 2) catch e => println(e.getStackTrace()(0)) try assertTrue(1 == 3) catch e => println(e.getStackTrace()(0))
Test$.main(Test.scala:5) Test$.main(Test.scala:5)
Test$.main(Test.scala:3) Test$.main(Test.scala:4)
The content of the inner quote gets a wrong position:
new Error@<macros.scala:7>@<macros.scala:7>@<macros.scala:7>( ""@<Test.scala:5>@<macros.scala:7> )@<macros.scala:7>
I think that this is due to Positioned#cloneIn not updating Positioned#source (origin: #9900).
Positioned#cloneIn
Positioned#source
The text was updated successfully, but these errors were encountered:
Fix #13626
a536ef0
assert
e6ffc0d
Fix Positioned#cloneIn to also update the source
d717d9e
Fixes #13626 (regression introduced in #9900).
abbf09f
Fixes scala#13626 (regression introduced in scala#9900).
effbce3
mbovel
Successfully merging a pull request may close this issue.
Compiler version
8246a7b
Minimized code
macros.scala
:Test.scala
:Output
Expectation
Cause
The content of the inner quote gets a wrong position:
I think that this is due to
Positioned#cloneIn
not updatingPositioned#source
(origin: #9900).The text was updated successfully, but these errors were encountered: