Skip to content

Macro expansion failed with missing positions #6048

New issue

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

Closed
liufengyun opened this issue Mar 8, 2019 · 0 comments
Closed

Macro expansion failed with missing positions #6048

liufengyun opened this issue Mar 8, 2019 · 0 comments

Comments

@liufengyun
Copy link
Contributor

The macro system should have set default positions to all trees, however when compile ScalaTest, we encountered the following exception:

[error] ## Exception when compiling 511 sources to /Users/fliu/Documents/scalatest-upstream/scalatest.dotty/target/scala-0.14/classes
[error] assertion failed: position not set for org.scalactic.anyvals.PosZInt.+$extension3(SizeParam.this.minSize)(
[error]   org.scalactic.anyvals.PosZInt.widenToInt(SizeParam.this.sizeRange)
[error] ) # 2326942 of class dotty.tools.dotc.ast.Trees$Apply in /Users/fliu/Documents/dotty/library/src-bootstrapped/scala/tasty/reflect/utils/TreeUtils.scala
[error] dotty.DottyPredef$.assertFail(DottyPredef.scala:16)
[error] dotty.tools.dotc.typer.Typer$.assertPositioned(Typer.scala:62)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:2096)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:2112)
[error] dotty.tools.dotc.typer.Typer.typedInlined(Typer.scala:1246)
[error] dotty.tools.dotc.transform.Erasure$Typer.typedInlined(Erasure.scala:559)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2032)

These kind of errors will cause a lot of troubles to macro authors -- as there is no way to explain why it happens and how to avoid that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant