File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -55,11 +55,11 @@ abstract class Positioned(implicit @constructorOnly src: SourceFile) extends Src
55
55
def sourcePos (using Context ): SourcePosition =
56
56
val info = WrappedSourceFile .locateMagicHeader(source)
57
57
info match
58
- case HasHeader (offset, originalFile) =>
59
- if span.start >= offset then // This span is in user code
58
+ // This span is in user code
59
+ case HasHeader (offset, originalFile)
60
+ if span != NoSpan && span.start >= offset =>
60
61
originalFile.atSpan(span.shift(- offset))
61
- else // Otherwise, return the source position in the wrapper code
62
- source.atSpan(span)
62
+ // Otherwise, return the source position in the wrapper code
63
63
case _ => source.atSpan(span)
64
64
65
65
/** This positioned item, widened to `SrcPos`. Used to make clear we only need the
You can’t perform that action at this time.
0 commit comments