Skip to content

Commit 16752df

Browse files
committed
Survive missing spans in constructor check
1 parent bf465c1 commit 16752df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1563,7 +1563,7 @@ class Typer extends Namer
15631563

15641564
def checkThisConstrCall(tree: Tree): Unit = tree match {
15651565
case app: Apply if untpd.isSelfConstrCall(app) =>
1566-
if (sym.span.start <= app.symbol.span.start)
1566+
if (sym.span.exists && app.symbol.span.exists && sym.span.start <= app.symbol.span.start)
15671567
ctx.error("secondary constructor must call a preceding constructor", app.sourcePos)
15681568
case Block(call :: _, _) => checkThisConstrCall(call)
15691569
case _ =>

0 commit comments

Comments
 (0)