diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala b/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala index 38e5617fc3d7..4f4caf36d92a 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala @@ -626,7 +626,7 @@ trait BCodeSkelBuilder extends BCodeHelpers { val nr = val sourcePos = tree.sourcePos ( - if sourcePos.exists then sourcePos.finalPosition.line + if sourcePos.exists then sourcePos.source.positionInUltimateSource(sourcePos).line else ctx.source.offsetToLine(tree.span.point) // fallback ) + 1 diff --git a/compiler/src/dotty/tools/dotc/util/SourcePosition.scala b/compiler/src/dotty/tools/dotc/util/SourcePosition.scala index 384d2f1fb2f3..a7358755043c 100644 --- a/compiler/src/dotty/tools/dotc/util/SourcePosition.scala +++ b/compiler/src/dotty/tools/dotc/util/SourcePosition.scala @@ -79,11 +79,6 @@ extends SrcPos, interfaces.SourcePosition, Showable { rec(this) } - def finalPosition: SourcePosition = { - source.positionInUltimateSource(this) - } - - override def toString: String = s"${if (source.exists) source.file.toString else "(no source)"}:$span"