-
Notifications
You must be signed in to change notification settings - Fork 3.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
Use correct range for error in escape [ci: last-only] #10740
Conversation
Apparently, the invariant, that point is in range, is not enforced. I expected start <= point < end, but "zero extent" ranges are typical, also in dotty spans. Splitting this commit into the pos fix for interpolator (plus gratuitous refactoring), then the tweak that you can request a spanning pos to include your default.point; otherwise a default.point out of range is ignored. The tweaks improve point positioning, but as noted on the ancient PR for NamesDefault, it's difficult to code defensively because it's easy to accidentally derive a range via For example, |
772bb9f
to
ee24067
Compare
At any phase.
|
6d94232
to
1688a6b
Compare
/rebuild |
1688a6b
to
e146e7e
Compare
@@ -1,4 +1,4 @@ | |||
t12155.scala:6: error: class Node in class C1 cannot be accessed as a member of C1[A,_$1] from package <empty> | |||
class D[A, C](val x: C1[A, _]#Node[C]) { | |||
^ | |||
^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not an obvious improvement
Maybe it's time to follow Scala 3 and underline the range instead of the finicky point. |
The failure on the first commit was weird.
The failure on the last commit was the new check file from #10792 The checks were green before rebasing. |
Looks all good to me, thank you! The change to |
This comment was marked as resolved.
This comment was marked as resolved.
I intend to improve the code comment on widening pos. I believe I did start by asserting that point was in range. |
I haven't looked at this again yet, but "For warnings" fails the test for positions of
where x overlaps with y, so x is focused on the x. I didn't touch positions in that PR, but I see this touches mkClosure. Retronym's fix that induces focus was to supply the position of the rhs It's by a pernicious coincidence that I must refresh my memory on positions, so it might be opportune to refresh this PR. Edit: morning after, it was just a cut/paste error. |
7cdc176
to
ace2117
Compare
rebased on "for warnings". |
let me know when it's ready for another 👀 |
I was just looking for a new adventure in rebasing. Maybe I can figure out what to cherry-pick. |
ace2117
to
fbe083e
Compare
Not sure about the history of the semantics of position operations, but I see these tweaks are coping with Symbolic ops seem to suggest notation, |
Fixes scala/bug#12981
This was broken since 2.13.0
FastStringInterpolator
. The bad position is just a bad caret for ordinary reporting, but causes downstream errors for other tooling.