-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix #14240: Fix off-by-1 when emitting Scala.js IR Positions. #14318
Conversation
@anatoliykmetyuk Hum, why did you assign me to my own PR? Do I need to change anything here? |
@sjrd is this one review-ready or did you intend to also write the test? |
Unless someone has any idea how we can write that programmatically calls the compiler, with the |
Could this be done as an sbt scripted test? We have one for scalajs already: https://github.com/lampepfl/dotty/tree/master/sbt-test/scalajs |
It's possible, sure. If you think that's not too much overhead. |
The scripted tests run reasonably fast nowadays so I think so, you could even replace the existing "basic" test. |
scalac positions are 1-based, while IR positions are 0-based. There is therefore a `- 1` in the nsc plugin, that was ported over to dotc without questioning. It turns out that dotc uses 0-based positions as well (as documented in `SourceFile`), and so we should not make any adaptation there.
528fd8e
to
2b76faa
Compare
All right. I updated the PR with a test in the existing scripted test. |
scalac positions are 1-based, while IR positions are 0-based. There is therefore a
- 1
in the nsc plugin, that was ported over to dotc without questioning. It turns out that dotc uses 0-based positions as well (as documented inSourceFile
), and so we should not make any adaptation there.I'm not sure how to write a test for this.