Skip to content

Scala 2.10.1 compatibility #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 11, 2013
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Scala 2.10.1 compat: apply renaming to originals of TypeTrees
This time in the ANF/Inline transformation.
  • Loading branch information
retronym committed Apr 10, 2013
commit 74beb1b751f6abf1775d6a8ec3eea4d63f3fd41f
5 changes: 5 additions & 0 deletions src/main/scala/scala/async/AnfTransform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ private[async] final case class AnfTransform[C <: Context](c: C) {
if (renamed(tree.symbol)) {
treeCopy.Select(tree, transform(fun), tree.symbol.name)
} else super.transform(tree)
case tt: TypeTree =>
val tt1 = tt.asInstanceOf[symtab.TypeTree]
val orig = tt1.original
if (orig != null) tt1.setOriginal(transform(orig.asInstanceOf[Tree]).asInstanceOf[symtab.Tree])
super.transform(tt)
case _ => super.transform(tree)
}
}
Expand Down
35 changes: 17 additions & 18 deletions src/test/scala/scala/async/run/anf/AnfTransformSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -112,24 +112,23 @@ class AnfTransformSpec {
State.result mustBe (14)
}

// TODO 2.10.1
// @Test
// def `inlining block does not produce duplicate definition`() {
// import scala.async.AsyncId
//
// AsyncId.async {
// val f = 12
// val x = AsyncId.await(f)
//
// {
// type X = Int
// val x: X = 42
// println(x)
// }
// type X = Int
// x: X
// }
// }
@Test
def `inlining block does not produce duplicate definition`() {
import scala.async.AsyncId

AsyncId.async {
val f = 12
val x = AsyncId.await(f)

{
type X = Int
val x: X = 42
println(x)
}
type X = Int
x: X
}
}

@Test
def `inlining block in tail position does not produce duplicate definition`() {
Expand Down