Skip to content

Prevent position errors on Ident(nme.ERROR) #4432

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

Merged

Conversation

Blaisorblade
Copy link
Contributor

@Blaisorblade Blaisorblade commented May 1, 2018

Stop-gap fix for

Exception in thread "main" java.lang.AssertionError: assertion failed: position error: position not set for Ident(<error>) # 24
	at dotty.DottyPredef$.assertFail(DottyPredef.scala:36)
	at dotty.tools.dotc.ast.Positioned.check$1(Positioned.scala:178)
	at dotty.tools.dotc.ast.Positioned.check$5$$anonfun$4(Positioned.scala:203)

which comes up often on the unminimized @alexknvl errors.

This fix looks wrong, and I've seen the comment in atPos on the logic I'm fighting against, but I don't yet understand the logic enough for a proper fix.

@Blaisorblade Blaisorblade self-assigned this May 1, 2018
```
Exception in thread "main" java.lang.AssertionError: assertion failed: position error: position not set for Ident(<error>) # 24
	at dotty.DottyPredef$.assertFail(DottyPredef.scala:36)
	at dotty.tools.dotc.ast.Positioned.check$1(Positioned.scala:178)
	at dotty.tools.dotc.ast.Positioned.check$5$$anonfun$4(Positioned.scala:203)
```
This reverts commit 0f7b1b0 but keeps the
testcase.
@Blaisorblade
Copy link
Contributor Author

@smarter I hear you're one of the few experts on positions bugs?

Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there is a special case because this is a Thicket. Normally an atPos of a parent node will set positions of Child nodes. But we never do the atPos on the Thicket since Thickets don't have position. So the fix looks good to me, even though it is not a beauty ;-)

@odersky odersky merged commit 4821e2b into scala:master Jul 1, 2018
@Blaisorblade Blaisorblade deleted the fix-positioned-error-ident-failure branch July 2, 2018 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants