aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/scala/async/neg/NakedAwait.scala
Commit message (Collapse)AuthorAgeFilesLines
* Incorporate pull request feedbackJason Zaugg2014-03-271-1/+1
| | | | | | | | | - remove unneeded `setType(NoType)`, which was leftover from my first attempts to find this bug. - fix typo in error message - optimize imports (cherry picked from commit 5c6ea29966fa80faae13892da50fc68ed1bf9ae7)
* [backport] Allow lazy vals without await in the initializerJason Zaugg2014-03-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | We were incorrectly typechecking the `ClassDef` of the state machine in the macro in a way that discarded the resulting trees, and only kept around the symbol. The led to the the macro engine retypechecking that node, which somehow led to duplicated lazy val initiaializer `DefDef`-s in the template, which manifest as a `VerifyError`. This commit: - rescues the typechecked `ClassDef` node from the eager typechecking by the macro - loosens the restriction on lazy vals in async blocks. They are still prohibited if they contain an await on the RHS - Adds a test that shows evalution is indeed lazy. (cherry picked from commit cc4587b1985519f7049d0feb0783d8e22c10f792) Conflicts: src/main/scala/scala/async/internal/AsyncAnalysis.scala src/main/scala/scala/async/internal/AsyncTransform.scala
* Update copyright years.Jason Zaugg2014-01-141-1/+1
| | | | 2013 must have been unlucky.
* Remove @RunWith annotations from test cases.Jason Zaugg2013-08-151-3/+0
| | | | | These are are at odds with the junit-interface SBT test framework under SBT 0.13.+, and appear to be superfluous.
* Disallow await in pattern guards (for now)Jason Zaugg2013-07-251-0/+10
|
* Move implementation details to scala.async.internal._.Jason Zaugg2013-07-071-14/+14
| | | | | If we intend to keep CPS fallback around for any length of time it should probably move there too.
* Mark `await` as @compileTimeOnlyJason Zaugg2013-04-171-1/+1
| | | | | | Rather than as @deprecated. This commit means we can no longer build against 2.10.0.
* Prohibit lazy vals in async blocks.Jason Zaugg2012-12-101-0/+12
|
* Workaround non-idempotency of typing pattern matching anonymous functions.Jason Zaugg2012-12-101-0/+10
| | | | | | | - 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
* Fix await in if condition / match scrutinee.Jason Zaugg2012-11-261-11/+0
| | | | | | The type-checking performed in ANF transform is precarious, and needed to use the original condition/ scrutinee in a throwaway tree to get things to work.
* add missing copyrightJason Zaugg2012-11-241-0/+4
|
* Prohibit await in if condition (for now)Jason Zaugg2012-11-241-0/+11
| | | | | | Test nested loops. Control ANF tracing with another system property.
* Prohibit return.Jason Zaugg2012-11-231-0/+12
| | | | Closes #21
* Explicitly prohibit await in nested methods.Jason Zaugg2012-11-231-0/+10
|
* Support await in a while loop.Jason Zaugg2012-11-231-16/+0
|
* Test for await in while (currently forbidden).Jason Zaugg2012-11-231-0/+16
| | | | Lookup the ValDef symbol from Assign#rhs.symbol.
* Forbid await in try/catch.Jason Zaugg2012-11-231-0/+30
|
* Support match as an expression.Jason Zaugg2012-11-221-2/+1
| | | | | | | | - corrects detection of await calls in the ANF transform. - Split AsyncAnalyzer into two parts. Unsupported await detection must happen prior to the async transform to prevent the ANF lifting out by-name arguments to vals and hence changing the semantics.
* Only transform if/match-s that contain an await.Jason Zaugg2012-11-211-0/+72
| | | | | | Accurate reporting of misplaced awaits. Attempt to collect the minimal set of vars to lift.
* Use @deprecated as a poor-man's @compileTimeOnlyJason Zaugg2012-11-061-0/+19
This helps detect naked awaits.