aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala
Commit message (Collapse)AuthorAgeFilesLines
* Address review commentphaller2012-11-261-3/+1
|
* Fix #19phaller2012-11-261-26/+66
| | | | | | | - Add tests where the result of an await is assigned to a variable external to the async block. - Clean up HygieneSpec.
* add missing copyrightJason Zaugg2012-11-2419-10/+46
|
* Prohibit await in if condition (for now)Jason Zaugg2012-11-243-14/+48
| | | | | | 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-232-2/+11
|
* Enable debug logging with a system property.Jason Zaugg2012-11-231-4/+5
|
* Support await in a while loop.Jason Zaugg2012-11-233-28/+60
|
* Test for await in while (currently forbidden).Jason Zaugg2012-11-232-0/+37
| | | | Lookup the ValDef symbol from Assign#rhs.symbol.
* Forbid await in try/catch.Jason Zaugg2012-11-231-0/+30
|
* Fix #31, Unfinished ANF transformJason Zaugg2012-11-232-1/+34
| | | | | | | | Prepend {(); ... } before starting the ANF transform. Add tracing to the anf/inline transform. Also enables and addresses SIP-18 warnings.
* Move TestUtils contents directly into the package object.Jason Zaugg2012-11-232-59/+42
| | | | Why suffer SI-4695 needlessly?
* Ensure unique names for definitions in the async block.Jason Zaugg2012-11-232-32/+33
| | | | | | | | - transform the provided tree using reflect.internal.Symbols#Symbol.name_= and treeCopy.{Ident, Select}. - not sure if this is possible within the public Symbol API. - move checking for unsupported nested module/class to AsyncAnalysis. - make block merging selective (only do so if there are nested await calls.)
* Support match as an expression.Jason Zaugg2012-11-224-28/+54
| | | | | | | | - 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.
* Cleanups and docs.Jason Zaugg2012-11-222-59/+32
| | | | | - Move now-working duplicate definition tests from `neg` to `run`. - Renames and small code beautification around the var lifting analysis
* Minimize lifting of vars.Jason Zaugg2012-11-221-2/+1
|
* Preserve ValDef symbol.Jason Zaugg2012-11-211-1/+3
|
* Only transform if/match-s that contain an await.Jason Zaugg2012-11-213-4/+76
| | | | | | Accurate reporting of misplaced awaits. Attempt to collect the minimal set of vars to lift.
* Add negative tests for inlining blocks in ANF transformphaller2012-11-201-0/+57
|
* Generate cleaner code for Unit-typed if-else expressionsphaller2012-11-161-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of generating an assignment to a Unit-typed variable, just add the Unit value after the if-else expression: [async] scala.async.Async.async[Unit]({ val f: scala.concurrent.Future[Int] = AnfTestClass.this.base(y); if (y.>(0)) State.result_=(scala.async.Async.await[Int](f).+(2)) else State.result_=(scala.async.Async.await[Int](f).-(2)) }) [async] ANF transform expands to: { val f: scala.concurrent.Future[Int] = AnfTestClass.this.base(y); if (y.>(0)) { val await$8: Int = scala.async.Async.await[Int](f); State.result_=(await$8.+(2)) } else { val await$9: Int = scala.async.Async.await[Int](f); State.result_=(await$9.-(2)) }; () }
* Add selective ANF transformphaller2012-11-161-0/+94
| | | | | - Does not descend into class and module defs - Adds several tests, including tests for if-else
* Fix merge conflicts and testsphaller2012-11-1214-16/+177
|\
| * Add a test to interrogate the expanded tree.Jason Zaugg2012-11-112-3/+44
| | | | | | | | | | | | | | - checks that only one function is synthesized - checks the set of vars created (TODO minimize these) - use x$1 rather than x1 for the freshened names for lifted vars. - make execContext a val, not a var.
| * Fixes #7, allow async blocks without await or with a single expression.Jason Zaugg2012-11-111-0/+34
| |
| * Synthesize `case 23 => rhs` rather than `case any @ (_: Int) if any == 25)`Jason Zaugg2012-11-111-1/+0
| |
| * Test with less trivial types.Jason Zaugg2012-11-091-0/+39
| | | | | | | | Works like it says on the box.
| * Avoid hygiene problems by suffixing result/result/state.Jason Zaugg2012-11-091-0/+52
| | | | | | | | Perhaps we should freshen them, but that will be a little awkward in our reify block.
| * Remove sleeps from the tests.Jason Zaugg2012-11-098-12/+0
| |
* | Reject local object definitionsphaller2012-11-091-0/+13
| |
* | Add comment, and decode class namesphaller2012-11-091-0/+17
| |
* | Make test names uniformphaller2012-11-091-4/+4
| |
* | Reject local classes without crashingphaller2012-11-092-45/+83
| |
* | Add failing test case for local classes inside async blocksphaller2012-11-091-0/+45
|/
* Merge pull request #5 from phaller/wip-matchJason Zaugg2012-11-061-0/+73
|\ | | | | Support await inside match expressions
| * Support await inside match expressionsphaller2012-11-061-0/+73
| |
* | Use @deprecated as a poor-man's @compileTimeOnlyJason Zaugg2012-11-064-23/+41
|/ | | | This helps detect naked awaits.
* File naming consistency.Jason Zaugg2012-11-051-0/+0
|
* Move test utils into a package object, rather than base class.Jason Zaugg2012-11-0511-50/+50
|
* Expand build configuration.Jason Zaugg2012-11-058-12/+12
| | | | | | | - Enable continuations plugin - Fill in project metadata - Enable stricter compiler options - satisfy -Xlint with some empty parens.
* Improve test infrastructureJason Zaugg2012-11-0510-0/+587
- Convert tests to use JUnit - For the 'run' tests, just use plain-old-test-cases - Add a sample 'neg' test to use ToolBoxes to compile code snippets on the fly.