diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-12-10 11:44:39 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-12-10 11:44:39 +0100 |
commit | 8b7e520b7d66abe14560508a24fe88d99fbedd9e (patch) | |
tree | 0b3bc74cbe02c6603d845c81fae53e4f69815eaf /src/test/scala/scala/async/neg | |
parent | 7c93a9e0e288b55027646016913c7368732d54e4 (diff) | |
download | scala-async-8b7e520b7d66abe14560508a24fe88d99fbedd9e.tar.gz scala-async-8b7e520b7d66abe14560508a24fe88d99fbedd9e.tar.bz2 scala-async-8b7e520b7d66abe14560508a24fe88d99fbedd9e.zip |
Workaround non-idempotency of typing pattern matching anonymous functions.
- Undo the transformation that takes place in Typers to
leave us with Match(EmptyTree, cases).
- Make sure we don't descend into the cases of such a
tree when peforming the async transform
Diffstat (limited to 'src/test/scala/scala/async/neg')
-rw-r--r-- | src/test/scala/scala/async/neg/NakedAwait.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/scala/scala/async/neg/NakedAwait.scala b/src/test/scala/scala/async/neg/NakedAwait.scala index ecc84f9..9974a07 100644 --- a/src/test/scala/scala/async/neg/NakedAwait.scala +++ b/src/test/scala/scala/async/neg/NakedAwait.scala @@ -93,6 +93,16 @@ class NakedAwait { } @Test + def nestedPatMatFunction() { + expectError("await must not be used under a nested class.") { // TODO more specific error message + """ + | import _root_.scala.async.AsyncId._ + | async { { case x => { await(false) } } : PartialFunction[Any, Any] } + """.stripMargin + } + } + + @Test def tryBody() { expectError("await must not be used under a try/catch.") { """ |