@@ -3,26 +3,24 @@ package backend
33package jvm
44
55import scala .language .unsafeNulls
6-
76import scala .annotation .tailrec
8-
9- import scala .collection .{ mutable , immutable }
10-
7+ import scala .collection .{immutable , mutable }
118import scala .tools .asm
129import dotty .tools .dotc .ast .tpd
1310import dotty .tools .dotc .ast .TreeTypeMap
1411import dotty .tools .dotc .CompilationUnit
15- import dotty .tools .dotc .core .Decorators ._
16- import dotty .tools .dotc .core .Flags ._
17- import dotty .tools .dotc .core .StdNames ._
18- import dotty .tools .dotc .core .NameKinds ._
12+ import dotty .tools .dotc .ast .Trees .SyntheticUnit
13+ import dotty .tools .dotc .core .Decorators .*
14+ import dotty .tools .dotc .core .Flags .*
15+ import dotty .tools .dotc .core .StdNames .*
16+ import dotty .tools .dotc .core .NameKinds .*
1917import dotty .tools .dotc .core .Names .TermName
20- import dotty .tools .dotc .core .Symbols ._
21- import dotty .tools .dotc .core .Types ._
22- import dotty .tools .dotc .core .Contexts ._
23- import dotty .tools .dotc .util .Spans ._
18+ import dotty .tools .dotc .core .Symbols .*
19+ import dotty .tools .dotc .core .Types .*
20+ import dotty .tools .dotc .core .Contexts .*
21+ import dotty .tools .dotc .util .Spans .*
2422import dotty .tools .dotc .report
25- import dotty .tools .dotc .transform .SymUtils ._
23+ import dotty .tools .dotc .transform .SymUtils .*
2624
2725/*
2826 *
@@ -624,16 +622,17 @@ trait BCodeSkelBuilder extends BCodeHelpers {
624622 case _ => a
625623 }
626624
627- if (! emitLines || ! tree.span.exists) return ;
628- val nr = ctx.source.offsetToLine(tree.span.point) + 1
629- if (nr != lastEmittedLineNr) {
630- lastEmittedLineNr = nr
631- getNonLabelNode(lastInsn) match {
632- case lnn : asm.tree.LineNumberNode =>
633- // overwrite previous landmark as no instructions have been emitted for it
634- lnn.line = nr
635- case _ =>
636- mnode.visitLineNumber(nr, currProgramPoint())
625+ if (emitLines && tree.span.exists && ! tree.hasAttachment(SyntheticUnit )) {
626+ val nr = ctx.source.offsetToLine(tree.span.point) + 1
627+ if (nr != lastEmittedLineNr) {
628+ lastEmittedLineNr = nr
629+ getNonLabelNode(lastInsn) match {
630+ case lnn : asm.tree.LineNumberNode =>
631+ // overwrite previous landmark as no instructions have been emitted for it
632+ lnn.line = nr
633+ case _ =>
634+ mnode.visitLineNumber(nr, currProgramPoint())
635+ }
637636 }
638637 }
639638 }
0 commit comments