diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-11-23 23:44:24 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-11-23 23:44:24 +0100 |
commit | 08bd93c20bcdd1bddc172c1477e811e8fc7f8ebd (patch) | |
tree | f05d905047a0e5ed3c2560b4b2b465b50c15a7b4 /src/main/scala | |
parent | d193065827c40002de1e56c316eb026907536c17 (diff) | |
download | scala-async-08bd93c20bcdd1bddc172c1477e811e8fc7f8ebd.tar.gz scala-async-08bd93c20bcdd1bddc172c1477e811e8fc7f8ebd.tar.bz2 scala-async-08bd93c20bcdd1bddc172c1477e811e8fc7f8ebd.zip |
Prohibit return.
Closes #21
Diffstat (limited to 'src/main/scala')
-rw-r--r-- | src/main/scala/scala/async/AsyncAnalysis.scala | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/scala/scala/async/AsyncAnalysis.scala b/src/main/scala/scala/async/AsyncAnalysis.scala index 38fd22f..e319fe8 100644 --- a/src/main/scala/scala/async/AsyncAnalysis.scala +++ b/src/main/scala/scala/async/AsyncAnalysis.scala @@ -62,6 +62,8 @@ private[async] final case class AsyncAnalysis[C <: Context](override val c: C) e tree match { case Try(_, _, _) if containsAwait => reportUnsupportedAwait(tree, "try/catch") + case Return(_) => + c.abort(tree.pos, "return is illegal within a async block") case _ => super.traverse(tree) } |