File tree 3 files changed +28
-1
lines changed
compiler/src/dotty/tools/dotc/typer 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ object Inliner {
165
165
case _ =>
166
166
val transformed = super .transform(tree)
167
167
enclosingInlineds match {
168
- case call :: _ if call.symbol.topLevelClass != ctx.owner.topLevelClass =>
168
+ case call :: _ if call.symbol.sourceFile != ctx.owner.sourceFile =>
169
169
// reposition tree inlined from some other file
170
170
transformed.withPos(inlinedAtPos)
171
171
case _ => transformed
Original file line number Diff line number Diff line change
1
+ track: Test$.main(i4947c.scala:4)
2
+ track: Test$.main(i4947c.scala:5)
3
+ main1: Test$.main(i4947c.scala:18)
4
+ main2: Test$.main(i4947c.scala:19)
Original file line number Diff line number Diff line change
1
+ object Aux {
2
+
3
+ transparent def track [T ](f : => T ): T = {
4
+ printStack(" track" )
5
+ printStack(" track" )
6
+ f
7
+ }
8
+
9
+ def printStack (tag : String ): Unit = {
10
+ println(tag + " : " + new Exception ().getStackTrace().apply(1 ))
11
+ }
12
+ }
13
+
14
+ object Test {
15
+ import Aux ._
16
+ def main (args : Array [String ]): Unit = {
17
+ track {
18
+ printStack(" main1" )
19
+ printStack(" main2" )
20
+ }
21
+ }
22
+
23
+ }
You can’t perform that action at this time.
0 commit comments