aboutsummaryrefslogtreecommitdiff
path: root/src/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Update copyright years.Jason Zaugg2014-01-1422-23/+23
| | | | 2013 must have been unlucky.
* Fix crashers in do/while and while(await(..))Jason Zaugg2013-11-222-31/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | The new tree shapes handled for do/while look like: // type checked async({ val b = false; doWhile$1(){ await(()); if (b) doWhile$1() else () }; () }) We had to change ExprBuilder to create states for the if/else that concludes the doWhile body, and also loosen the assertion that the label jump must be the last thing we see. We also have to look for more than just `containsAwait` when deciding whether an `If` needs to be transformed into states; it might also contain a jump to the enclosing label that is on the other side of an `await`, and hence needs to be a state transition instead.
* Fix crasher in icode due to symbol mismatches in lifted methodsJason Zaugg2013-11-141-0/+50
| | | | | | | | | These stem from the handling of the internal/external view or method type parameters by `thisMethodType` in `Namers`. I've now preseversed the orginal ValDefs favoured the latter when constructing the new DefDef, and made construction of all liftables consistent in this regard.
* Don't aggressively null out captured varsJason Zaugg2013-11-122-7/+151
| | | | | Once they escape, we leave the references in the state machines fields untouched.
* Minimize the public APIJason Zaugg2013-11-071-46/+0
| | | | | | | | | | - Remove the CPS fallback version of async. That was not intended to be part of 1.0. - Lookup the await method beside the macro, rather than requiring all calls to go to AsyncBase.await. - Create a minimal version of Async that just contains await/async and delegates to the macro implementation in internal._ - Add scaladoc.
* Scala 2.11 compatibilityJason Zaugg2013-11-071-0/+2
| | | | | | We were relying on an internal API that no longer exists. We also need to tweak the way our tests infer scalaBinaryVersion.
* Avoid zero-ing out dead fields of primitive value class typePhilipp Haller2013-10-221-10/+122
| | | | | - Zero out fields of type Any - Zero out fields of value class type
* Enables testing the resetting of lifted local variablesPhilipp Haller2013-10-221-0/+40
| | | | | | | - Adds a hook that lets a derived macro insert additional code when zero-ing out a lifted field. - Adds a variant of the `AsyncId` macro that logs zeroed-out fields. - Adds a test using this mechanism
* Handle while loops as expressions in ANF transform.Jason Zaugg2013-10-141-0/+14
| | | | | | | Append a `()`, as we do for `Unit` returning `if`-s and `try-s` We don't currently support `await` in try/catch, otherwise I'd write tests for that case, too.
* Merge pull request #30 from retronym/topic/unchecked-boundsJason Zaugg2013-08-2322-64/+65
|\ | | | | Use @uncheckedBounds to avoid introducing refchecks errors …
| * Use @uncheckedBounds to avoid introducing refchecks errorsJason Zaugg2013-08-222-1/+65
| | | | | | | | | | | | | | | | | | ... in code that would otherwise have smuggled through these slack LUBs in the types of trees but never in a TypeTree. More details in SI-7694. Fixes #29
| * Remove @RunWith annotations from test cases.Jason Zaugg2013-08-1521-63/+0
| | | | | | | | | | These are are at odds with the junit-interface SBT test framework under SBT 0.13.+, and appear to be superfluous.
* | Collection of clean-upsPhilipp Haller2013-08-141-1/+0
|/ | | | | | - removed outdated comments in ANF transform - added a few comments - removed some unnecessary imports
* Set the type of case bodies to Unit after ANF.Jason Zaugg2013-08-071-0/+14
| | | | Avoids runtime errors like: "java.lang.Double cannot be cast to scala.runtime.BoxedUnit"
* Disallow await in pattern guards (for now)Jason Zaugg2013-07-251-0/+10
|
* Preserve ApplyImplicitView / ApplyImplicitArgs in AnfTransform.Jason Zaugg2013-07-252-6/+21
|
* Test case for await in an Assign node.Jason Zaugg2013-07-241-0/+11
| | | | This case already works.
* Support await in Typed nodes.Jason Zaugg2013-07-241-0/+8
|
* Support await in throws.Jason Zaugg2013-07-241-0/+10
| | | | | Also support AsyncId.async[Nothing], which was triggering a NPE in the generated `null.asInstanceOf[Nothing]`.
* Fix "BoxedUnit cannot be cast to String" error.Jason Zaugg2013-07-091-0/+21
| | | | | When convering If and Match nodes to ANF, set the type to Unit. Otherwise, erasure might end up casting BoxedUnit to a real type.
* Move implementation details to scala.async.internal._.Jason Zaugg2013-07-0711-41/+47
| | | | | If we intend to keep CPS fallback around for any length of time it should probably move there too.
* Fix another interation with existentials and a name clash.Jason Zaugg2013-07-073-2/+46
|
* An overdue overhaul of macro internals.Jason Zaugg2013-07-035-110/+115
| | | | | | | | | | | | - Avoid reset + retypecheck, instead hang onto the original types/symbols - Eliminated duplication between AsyncDefinitionUseAnalyzer and ExprBuilder - Instead, decide what do lift *after* running ExprBuilder - Account for transitive references local classes/objects and lift them as needed. - Make the execution context an regular implicit parameter of the macro - Fixes interaction with existential skolems and singleton types Fixes #6, #13, #16, #17, #19, #21.
* Avoid hardcoded "2.10" in tests.Jason Zaugg2013-07-022-4/+19
| | | | This allows us to cross build against 2.10.x and 2.11.x.
* 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.
* Merge pull request #9 from retronym/ticket/4-multi-paramPhilipp Haller2013-04-172-28/+65
|\ | | | | Allow await in applications with multiple argument lists
| * Allow await in applications with multiple argument listsJason Zaugg2013-04-112-28/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, we levied an implementation restriction to prevent this. As it turned out, that needlessly prevented use of `await` in the receiver of a multi-param-list application. This commit lifts the restriction altogether, and treats such applications holistically, being careful to preserve the left-to-right evaluation order of arguments in the translated code. - use `TreeInfo.Applied` and `Type#paramss` from `reflect.internal` to get the info we need - use the parameter name for the lifted argument val, rather than `argN` - encapsulate handling of by-name-ness and parameter names in `mapArgumentss` - test for evaluation order preservation
* | Remove CPS dependency from default async implementationPhilipp Haller2013-04-121-0/+49
|/ | | | | | - move all CPS-related code to `continuations` sub package - fix CPS-based async implementation - enable testing of CPS-based async implementation
* Scala 2.10.1 compat: apply renaming to originals of TypeTreesJason Zaugg2013-04-101-18/+17
| | | | This time in the ANF/Inline transformation.
* Scala 2.10.1 compat: account for change in PartialFunction synthesis.Jason Zaugg2013-04-101-21/+19
| | | | | | | | | | | Since SI-6187, the default case of a partial function is now included in the tree. Before, it was a tree attachment, conditionally inserted in the pattern matcher. I had hoped that that change would allow us to do away with `RestorePatternMatchingFunctions` altogether, but it seems that we aren't so lucky. Instead, I've adapted that transformer to account for the new scheme.
* Scala 2.10.1 compat: apply renaming to originals of TypeTreesJason Zaugg2013-04-102-19/+20
|
* Temporarily comment out tests that are failing under 2.10.1.Jason Zaugg2013-04-104-61/+66
|
* Address lint warnings.Jason Zaugg2013-04-101-2/+2
|
* Remove unreachable code in pattern matching testphaller2012-12-201-1/+0
|
* Merge pull request #49 from phaller/topic/patmat-partial-functionJason Zaugg2012-12-193-11/+62
|\ | | | | Topic/patmat partial function
| * Prohibit lazy vals in async blocks.Jason Zaugg2012-12-101-0/+12
| |
| * Workaround non-idempotency of typing pattern matching anonymous functions.Jason Zaugg2012-12-103-11/+50
| | | | | | | | | | | | | | - 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 ANF transform involving `xs: _*` trees.Jason Zaugg2012-11-271-0/+22
|/ | | | | | | | We need to unwrap and inline `xs`, then rewrap the result expression with the wildcard star. Addresses the first half of #46.
* No need to extract vals for inlinable args.Jason Zaugg2012-11-271-11/+9
| | | | | | We use `isExprSafeToInline` from the non-public reflection API to check. In addtion, we now that an untyped Ident("await$N") is also an inlinable expression.
* Test cases for named and default args.Jason Zaugg2012-11-271-1/+35
|
* Disallow await in non-primary param sections.Jason Zaugg2012-11-271-2/+30
| | | | | | | | | We can allow it, but we need to treat nested Apply trees holistically, in order to lift out all the arguments and maintain the correct evaluation order. Fixes #33.
* Fix semantics of by-name applicationJason Zaugg2012-11-271-0/+22
| | | | | | | | - If we lift one arg, we must lift them all. This preserves evaluation order. - But, never lift an by-name arg Addresses the first half of #33.
* Lookup log level dynamically from system property.Jason Zaugg2012-11-271-17/+17
| | | | | | And change TreeInterrogation to set if via this means, rather than through a direct means, which seems to assume too much about classloaders.
* More tests for ExceptionsSpecphaller2012-11-261-8/+30
|
* Fix #42 - Futures created by async are not properly completed with exceptionsphaller2012-11-262-15/+58
| | | | | | | | | | | | This augments the on-complete handler for an async state with await as follows: if (tr.isFailure) result$async.complete(tr.asInstanceOf[Try[T]]) else { <resultName> = tr.get.asInstanceOf[<resultType>] <nextState> <mkResumeApply> }
* Merge pull request #37 from phaller/ticket/23-port-futures-testsPhilipp Haller2012-11-261-0/+536
|\ | | | | Port futures tests of scala.concurrent
| * Replace uses of Future.map/Future.flatMap with async+awaitphaller2012-11-261-24/+33
| |
| * Add ported futures testsphaller2012-11-261-0/+527
| | | | | | | | | | | | These tests do not use async/await, yet. Refs #23
* | Show that indirectly nested defs aren't lifted.Jason Zaugg2012-11-262-3/+18
| |
* | Make the name uniqification more selective.Jason Zaugg2012-11-261-1/+1
| | | | | | | | | | | | We need not, and should not, rename definitions beyond the scope of the async transform, e.g. in nested classes of function bodies.