Skip to content

Commit e3bc344

Browse files
authored
Merge pull request #6108 from dotty-staging/fix-#6035
Fix #6035: Make sure assigned positions in Parser contain child posit…
2 parents 44e6d0f + 8c6231a commit e3bc344

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ object Parsers {
8080
* If `t` does not have a span yet, set its span to the given one.
8181
*/
8282
def atSpan[T <: Positioned](span: Span)(t: T): T =
83-
if (t.span.isSourceDerived) t else t.withSpan(span)
83+
if (t.span.isSourceDerived) t else t.withSpan(span.union(t.span))
8484

8585
def atSpan[T <: Positioned](start: Offset, point: Offset, end: Offset)(t: T): T =
8686
atSpan(Span(start, end, point))(t)

tests/neg/i6035.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
type i1 <: i1 = ; } // error // error

0 commit comments

Comments
 (0)