Skip to content

Commit b9c7e75

Browse files
committed
revert change to sourcePos
1 parent 91cb4a0 commit b9c7e75

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

compiler/src/dotty/tools/dotc/util/SourcePosition.scala

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ package dotty.tools
22
package dotc
33
package util
44

5-
import scala.language.{unsafeNulls => _}
6-
75
import printing.{Showable, Printer}
86
import printing.Texts._
97
import core.Contexts.Context
@@ -67,7 +65,7 @@ extends SrcPos, interfaces.SourcePosition, Showable {
6765
def toSynthetic: SourcePosition = withSpan(span.toSynthetic)
6866

6967
def outermost: SourcePosition =
70-
if outer == NoSourcePosition then this else outer.outermost
68+
if outer == null || outer == NoSourcePosition then this else outer.outermost
7169

7270
/** Inner most position that is contained within the `outermost` position.
7371
* Most precise position that comes from the call site.
@@ -87,7 +85,7 @@ extends SrcPos, interfaces.SourcePosition, Showable {
8785
}
8886

8987
/** A sentinel for a non-existing source position */
90-
@sharable object NoSourcePosition extends SourcePosition(NoSource, NoSpan) {
88+
@sharable object NoSourcePosition extends SourcePosition(NoSource, NoSpan, null) {
9189
override def line: Int = -1
9290
override def column: Int = -1
9391
override def toString: String = "?"

0 commit comments

Comments
 (0)