We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 853b0bf + 84d33d4 commit 3456e85Copy full SHA for 3456e85
compiler/src/dotty/tools/dotc/util/SourcePosition.scala
@@ -22,7 +22,7 @@ extends interfaces.SourcePosition with Showable {
22
23
def point: Int = span.point
24
25
- def line: Int = if (source.file.exists) source.offsetToLine(point) else -1
+ def line: Int = if (source.content().length != 0) source.offsetToLine(point) else -1
26
27
/** Extracts the lines from the underlying source file as `Array[Char]`*/
28
def linesSlice: Array[Char] =
0 commit comments