fix #25456: parser crash on polymorphic context bound - #25623
Merged
Conversation
som-snytt
approved these changes
Mar 26, 2026
som-snytt
left a comment
Contributor
There was a problem hiding this comment.
I hate it when that happens.
| ContextBoundTypeTree(t, pname, ownName).withSpan(newSpan) | ||
| val res = ContextBoundTypeTree(t, pname, ownName) | ||
| if t.span.exists then | ||
| res.withSpan(t.span.withPoint(t.span.end).withEnd(in.lastOffset)) |
Contributor
There was a problem hiding this comment.
If you choose, res.withSpan(Span(t.span.start, end = in.lastOffset, point = t.span.end)).
(Not sure if Scala 3 enforces invariants yet, but it was a Scala 2 issue that order matters.)
warcholjakub
force-pushed
the
fix/25456/polymorphic
branch
from
March 30, 2026 10:01
d8aa436 to
63857d8
Compare
Contributor
I almost said on the review that this is what LLM is not good at. (That is, verification.) Apparently, I was distracted by the mechanics of constructing a span.
You know who would have asked about the other case. |
Member
Author
|
Yeah, that's my bad. I thought that with a change so minimal, one review would suffice and didn't want to bother more people. |
Contributor
|
No, totally my bad. |
som-snytt
added a commit
that referenced
this pull request
Apr 16, 2026
tgodzik
added a commit
that referenced
this pull request
May 26, 2026
bishabosha
pushed a commit
to dotty-staging/dotty
that referenced
this pull request
Jun 5, 2026
Fixes scala#25716 Follow-up scala#25623 Supply a span at `ContextBound` (rather than defensively checking for a span up the stack).
alexarchambault
pushed a commit
to plasmon-scala/scala3
that referenced
this pull request
Jun 16, 2026
Fixes scala#25716 Follow-up scala#25623 Supply a span at `ContextBound` (rather than defensively checking for a span up the stack). [Cherry-picked 0bb5237]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #25456
Trying to access
endonNoSpan(span ofscalaAny) caused an assert to fail:The fix was to add a guard against
NoSpanincontextBound.How much have you relied on LLM-based tools in this contribution?
Minimally - to verify correctness of the solution.
How was the solution tested?
Added
tests/neg/i25456.scala.