File tree Expand file tree Collapse file tree 2 files changed +22
-18
lines changed
test/scala/scala/async/run/anf Expand file tree Collapse file tree 2 files changed +22
-18
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,11 @@ private[async] final case class AnfTransform[C <: Context](c: C) {
8888 if (renamed(tree.symbol)) {
8989 treeCopy.Select (tree, transform(fun), tree.symbol.name)
9090 } else super .transform(tree)
91+ case tt : TypeTree =>
92+ val tt1 = tt.asInstanceOf [symtab.TypeTree ]
93+ val orig = tt1.original
94+ if (orig != null ) tt1.setOriginal(transform(orig.asInstanceOf [Tree ]).asInstanceOf [symtab.Tree ])
95+ super .transform(tt)
9196 case _ => super .transform(tree)
9297 }
9398 }
Original file line number Diff line number Diff line change @@ -112,24 +112,23 @@ class AnfTransformSpec {
112112 State .result mustBe (14 )
113113 }
114114
115- // TODO 2.10.1
116- // @Test
117- // def `inlining block does not produce duplicate definition`() {
118- // import scala.async.AsyncId
119- //
120- // AsyncId.async {
121- // val f = 12
122- // val x = AsyncId.await(f)
123- //
124- // {
125- // type X = Int
126- // val x: X = 42
127- // println(x)
128- // }
129- // type X = Int
130- // x: X
131- // }
132- // }
115+ @ Test
116+ def `inlining block does not produce duplicate definition` () {
117+ import scala .async .AsyncId
118+
119+ AsyncId .async {
120+ val f = 12
121+ val x = AsyncId .await(f)
122+
123+ {
124+ type X = Int
125+ val x : X = 42
126+ println(x)
127+ }
128+ type X = Int
129+ x : X
130+ }
131+ }
133132
134133 @ Test
135134 def `inlining block in tail position does not produce duplicate definition` () {
You can’t perform that action at this time.
0 commit comments