Skip to content

Commit bcb949d

Browse files
authored
Merge pull request #620 from scala/backport-lts-3.3-24123
Backport "bugfix: Make sure that we can query tree.source" to 3.3 LTS
2 parents 1b9ec53 + 269f186 commit bcb949d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

presentation-compiler/src/main/dotty/tools/pc/utils/InteractiveEnrichments.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ object InteractiveEnrichments extends CommonMtagsEnrichments:
313313
case Select(_, name: TermName) if infixNames(name) => false
314314
case Select(This(_), _) => false
315315
// is a select statement without a dot `qual.name`
316-
case sel @ Select(qual, _) if !sel.symbol.is(Synthetic) =>
316+
case sel @ Select(qual, _) if !sel.symbol.is(Synthetic) && sel.nameSpan.start < tree.source.length =>
317317
val source = tree.source
318318
!(qual.span.end until sel.nameSpan.start)
319319
.map(source.apply)

0 commit comments

Comments
 (0)