We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7eaf07a commit 438b4c1Copy full SHA for 438b4c1
compiler/src/dotty/tools/dotc/ast/Positioned.scala
@@ -56,7 +56,10 @@ abstract class Positioned(implicit @constructorOnly src: SourceFile) extends Src
56
val info = WrappedSourceFile.locateMagicHeader(source)
57
info match
58
case HasHeader(offset, originalFile) =>
59
- originalFile.atSpan(span `shift` -offset)
+ if span.start >= offset then // This span is in user code
60
+ originalFile.atSpan(span.shift(-offset))
61
+ else // Otherwise, return the source position in the wrapper code
62
+ source.atSpan(span)
63
case _ => source.atSpan(span)
64
65
/** This positioned item, widened to `SrcPos`. Used to make clear we only need the
0 commit comments