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
This is an error encountered when working with ScalaTest (#5491 ). Given the macro definition below:
import scala.quoted._ import scala.tasty._ object scalatest { inline def assert(condition: => Boolean): Unit = ~assertImpl('(condition), '("")) def assertImpl(cond: Expr[Boolean], clue: Expr[Any])(implicit refl: Reflection): Expr[Unit] = { import refl._ val b = cond.unseal.underlyingArgument.seal[Boolean] '{ scala.Predef.assert(~b) } } inline def thisLineNumber = ~thisLineNumberImpl def thisLineNumberImpl(implicit refl: Reflection): Expr[Int] = { import refl._ refl.rootPosition.startLine.toExpr } }
The following code fails at runtime:
object Test { import scalatest._ def main(args: Array[String]): Unit = { val startLine = thisLineNumber assert(thisLineNumber == startLine + 1) // scala.Predef.assert(thisLineNumber == startLine + 1) // OK } }
The text was updated successfully, but these errors were encountered:
The issue is that underlyingArgument is dropping the Inlined node
underlyingArgument
Inlined
Sorry, something went wrong.
Workaround line number errors
56e319e
Now the line numbers are correct by accident. A walkaround for the issue blow: scala/scala3#5629
The commit in dotty-staging/scalatest@56e319e magically avoids the error.
803d869
Merge pull request #6065 from dotty-staging/fix-#5629
296222f
Fix #5629: Add regression test
No branches or pull requests
This is an error encountered when working with ScalaTest (#5491 ). Given the macro definition below:
The following code fails at runtime:
The text was updated successfully, but these errors were encountered: