@@ -3,26 +3,24 @@ package backend
3
3
package jvm
4
4
5
5
import scala .language .unsafeNulls
6
-
7
6
import scala .annotation .tailrec
8
-
9
- import scala .collection .{ mutable , immutable }
10
-
7
+ import scala .collection .{immutable , mutable }
11
8
import scala .tools .asm
12
9
import dotty .tools .dotc .ast .tpd
13
10
import dotty .tools .dotc .ast .TreeTypeMap
14
11
import 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 .*
19
17
import 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 .*
24
22
import dotty .tools .dotc .report
25
- import dotty .tools .dotc .transform .SymUtils ._
23
+ import dotty .tools .dotc .transform .SymUtils .*
26
24
27
25
/*
28
26
*
@@ -624,16 +622,17 @@ trait BCodeSkelBuilder extends BCodeHelpers {
624
622
case _ => a
625
623
}
626
624
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
+ }
637
636
}
638
637
}
639
638
}
0 commit comments