Skip to content

Commit

Permalink
revert change to sourcePos
Browse files Browse the repository at this point in the history
  • Loading branch information
noti0na1 committed Jan 20, 2022
1 parent 147b2c5 commit 366bea8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions compiler/src/dotty/tools/dotc/util/SourcePosition.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package dotty.tools
package dotc
package util

import scala.language.{unsafeNulls => _}

import printing.{Showable, Printer}
import printing.Texts._
import core.Contexts.Context
Expand Down Expand Up @@ -67,7 +65,7 @@ extends SrcPos, interfaces.SourcePosition, Showable {
def toSynthetic: SourcePosition = withSpan(span.toSynthetic)

def outermost: SourcePosition =
if outer == NoSourcePosition then this else outer.outermost
if outer == null || outer == NoSourcePosition then this else outer.outermost

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

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

0 comments on commit 366bea8

Please sign in to comment.