File tree Expand file tree Collapse file tree 3 files changed +58
-1
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 3 files changed +58
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ class LambdaLift extends MiniPhase with IdentityDenotTransformer { thisTransform
100100 * Note: During tree transform (which runs at phase LambdaLift + 1), liftedOwner
101101 * is also used to decide whether a method had a term owner before.
102102 */
103- private val liftedOwner = new HashMap [Symbol , Symbol ]
103+ private val liftedOwner = new LinkedHashMap [Symbol , Symbol ]
104104
105105 /** The outer parameter of a constructor */
106106 private val outerParam = new HashMap [Symbol , Symbol ]
Original file line number Diff line number Diff line change 1+ foo
2+ bar$1
3+ foo
4+ bar$2
5+ baz
6+ Test$qux$2$
7+ baz
8+ Test$qux$4$
Original file line number Diff line number Diff line change 1+ object Test {
2+
3+ def main (args : Array [String ]): Unit = {
4+ foo(1 )
5+ foo(" a" )
6+ baz(2 )
7+ baz(" b" )
8+ }
9+
10+ def foo [X <: Int ](x : X ) = {
11+ def bar = printlnThisMethodName()
12+ printlnThisMethodName()
13+ bar
14+ }
15+
16+ def foo (x : String ) = {
17+ def bar = printlnThisMethodName()
18+ printlnThisMethodName()
19+ bar
20+ }
21+
22+ def baz [X <: Int ](x : X ) = {
23+ object qux {
24+ override def toString () = {
25+ printlnThisMethodsClassName()
26+ " a"
27+ }
28+ }
29+ printlnThisMethodName()
30+ qux.toString()
31+ }
32+
33+ def baz (x : String ) = {
34+ object qux {
35+ override def toString () = {
36+ printlnThisMethodsClassName()
37+ " b"
38+ }
39+ }
40+ printlnThisMethodName()
41+ qux.toString()
42+ }
43+
44+ def printlnThisMethodName () =
45+ println(Thread .currentThread().getStackTrace()(2 ).getMethodName)
46+
47+ def printlnThisMethodsClassName () =
48+ println(Thread .currentThread().getStackTrace()(2 ).getClassName)
49+ }
You can’t perform that action at this time.
0 commit comments