diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-11-22 13:33:09 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-11-22 13:33:09 +0100 |
commit | 8e4a8ecdff955c4faa1dec344a2b93543ffe7d45 (patch) | |
tree | 8733f9b854baa83194b1688fa30ed5fc90fd249c /src/test/scala/scala/async/run/anf/AnfTransformSpec.scala | |
parent | a30ba69777a83d77b3924081f8b70d76c4a3ed59 (diff) | |
download | scala-async-8e4a8ecdff955c4faa1dec344a2b93543ffe7d45.tar.gz scala-async-8e4a8ecdff955c4faa1dec344a2b93543ffe7d45.tar.bz2 scala-async-8e4a8ecdff955c4faa1dec344a2b93543ffe7d45.zip |
Cleanups and docs.
- Move now-working duplicate definition tests from `neg` to `run`.
- Renames and small code beautification around the var lifting analysis
Diffstat (limited to 'src/test/scala/scala/async/run/anf/AnfTransformSpec.scala')
-rw-r--r-- | src/test/scala/scala/async/run/anf/AnfTransformSpec.scala | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/test/scala/scala/async/run/anf/AnfTransformSpec.scala b/src/test/scala/scala/async/run/anf/AnfTransformSpec.scala index f2fc2d7..0abb937 100644 --- a/src/test/scala/scala/async/run/anf/AnfTransformSpec.scala +++ b/src/test/scala/scala/async/run/anf/AnfTransformSpec.scala @@ -111,4 +111,36 @@ class AnfTransformSpec { Await.result(fut, 2 seconds) State.result mustBe (14) } + + @Test + def `inlining block produces duplicate definition`() { + import scala.async.AsyncId + + AsyncId.async { + val f = 12 + val x = AsyncId.await(f) + + { + val x = 42 + println(x) + } + + x + } + } + @Test + def `inlining block in tail position produces duplicate definition`() { + import scala.async.AsyncId + + AsyncId.async { + val f = 12 + val x = AsyncId.await(f) + + { + val x = 42 // TODO should we rename the symbols when we collapse them into the same scope? + x + } + } mustBe (42) + + } } |