aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/scala/async/Async.scala
Commit message (Collapse)AuthorAgeFilesLines
* copyright 2018 LightbendSeth Tisue2018-02-061-1/+1
|
* TypoBruno Bieth2015-08-181-1/+1
|
* Avoid dead code warning with async(throw T)Jason Zaugg2015-07-291-1/+1
| | | | | | By declararing the parameter of `async` as by-name. Fixes #150 (the bug in the original ticket.)
* Finalize the move to Scala 2.11.xJason Zaugg2014-02-211-1/+1
| | | | | | | | - Link to the 2.10.x branch from the README - use `scala.annotation.compileTimeOnly` (from scala-library.jar) - no longer impose a transitive dependency on scala-reflect and scala-compiler. - Update Travis CI configuration to use only 2.11.0-SNAPSHOT
* Update copyright years.Jason Zaugg2014-01-141-1/+1
| | | | 2013 must have been unlucky.
* Minor fixes in Async`s scaladoc.akomar2014-01-121-2/+2
|
* Minimize the public APIJason Zaugg2013-11-071-0/+55
| | | | | | | | | | - 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.
* Move implementation details to scala.async.internal._.Jason Zaugg2013-07-071-94/+0
| | | | | If we intend to keep CPS fallback around for any length of time it should probably move there too.
* An overdue overhaul of macro internals.Jason Zaugg2013-07-031-115/+24
| | | | | | | | | | | | - 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.
* Mark `await` as @compileTimeOnlyJason Zaugg2013-04-171-2/+2
| | | | | | Rather than as @deprecated. This commit means we can no longer build against 2.10.0.
* Remove CPS dependency from default async implementationPhilipp Haller2013-04-121-34/+3
| | | | | | - move all CPS-related code to `continuations` sub package - fix CPS-based async implementation - enable testing of CPS-based async implementation
* Address deprecation warnings in Scala 2.10.1Jason Zaugg2013-04-101-1/+1
|
* Resolve merge conflictphaller2012-12-191-9/+39
|\
| * New fix for #1861: Add fall-back to CPS for all unsupported uses of awaitphaller2012-12-191-9/+39
| | | | | | | | | | | | | | This is a re-implementation of a previous fix. It is more modular, since it enables the definition of a CPS-based fall-back as a subclass of `AsyncBase`. Thus, it's possible to define fall-back-enabled subclasses of `AsyncBase` targetting not only Scala Futures.
* | Merge pull request #49 from phaller/topic/patmat-partial-functionJason Zaugg2012-12-191-1/+2
|\ \ | |/ |/| Topic/patmat partial function
| * Workaround non-idempotency of typing pattern matching anonymous functions.Jason Zaugg2012-12-101-1/+2
| | | | | | | | | | | | | | - 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 typophaller2012-11-291-3/+3
| |
* | Remove @author tagsphaller2012-11-271-3/+0
|/
* Fix execution context lookup for the trivial async block.Jason Zaugg2012-11-271-1/+1
|
* Fix #26, leaner code gen for `async { <no awaits> }`.Jason Zaugg2012-11-261-9/+20
| | | | We can then use this as a replacement for `Future { expr }`.
* Rewrite the state machine to a class, rather than an object.Jason Zaugg2012-11-261-9/+15
| | | | | | | | | | | | To avoid suprises in tree retyping, the instance of this class is immediately upcase to StateMachine[Promise[T], ExecContext]. Allow nested non-case classes. These pop up when we use nested async calls. Only look for duplicate names in the subtrees traversed by AsyncTraverser.
* Preserve outer This() refs through resetAttrs.Jason Zaugg2012-11-261-11/+9
| | | | | | Adapt the compiler's standard ResetAttrs to keep This() nodes don't refer to a symbol defined in the current async block.
* Synthesize an object implementing Function#apply and resume()Jason Zaugg2012-11-261-28/+44
| | | | | | | | There is a fly in the ointment: any This() trees in the provided code are getting rebound to this class. Sounds like more resetAttrs fun ahead. The object also serves as the Future {} thunk.
* Lift local defs and functions.Jason Zaugg2012-11-261-2/+6
| | | | | | | Any vals referred to in the body of these must also be lifted. Fixes #36
* Refactor some tree creation from Async to ExprBuilder.Jason Zaugg2012-11-241-52/+5
|
* Tiny aesthetic refactorings.Jason Zaugg2012-11-241-2/+2
|
* More small refactorings.Jason Zaugg2012-11-241-1/+1
| | | | Goal is to make ExprBuilder less cluttered.
* Favouring composition over inheritance.Jason Zaugg2012-11-241-6/+5
|
* add missing copyrightJason Zaugg2012-11-241-1/+2
|
* Cleanup var lifting.Jason Zaugg2012-11-241-1/+4
| | | | | Seeing as we know in advance the full set of lifted vars, we don't need to thread this information through ExprBuilder.
* Tightenen up modifiers and other refactoring.Jason Zaugg2012-11-231-3/+3
|
* Fix #31, Unfinished ANF transformJason Zaugg2012-11-231-5/+2
| | | | | | | | Prepend {(); ... } before starting the ANF transform. Add tracing to the anf/inline transform. Also enables and addresses SIP-18 warnings.
* Ensure unique names for definitions in the async block.Jason Zaugg2012-11-231-2/+6
| | | | | | | | - 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.)
* Refactor the analyzers to a seprarate file.Jason Zaugg2012-11-221-2/+3
|
* Support match as an expression.Jason Zaugg2012-11-221-3/+3
| | | | | | | | - 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-221-28/+34
| | | | | - Move now-working duplicate definition tests from `neg` to `run`. - Renames and small code beautification around the var lifting analysis
* Remove unused imports.Jason Zaugg2012-11-221-8/+4
|
* Frugality is no longer required with state IDs.Jason Zaugg2012-11-221-4/+13
| | | | | | Change the way state IDs are allocated to avoid the need to ration them out. Also make the logging tolerant of a toolbox setting that doesn't have a source file.
* Minimize lifting of vars.Jason Zaugg2012-11-221-5/+5
|
* Preserve ValDef symbol.Jason Zaugg2012-11-211-0/+4
|
* Only transform if/match-s that contain an await.Jason Zaugg2012-11-211-0/+3
| | | | | | Accurate reporting of misplaced awaits. Attempt to collect the minimal set of vars to lift.
* Slight simplification of in-flight type checking.Jason Zaugg2012-11-211-5/+5
|
* Change type of name mapphaller2012-11-211-1/+2
|
* Clean up and improve debug/error outputphaller2012-11-161-1/+3
|
* Add selective ANF transformphaller2012-11-161-2/+10
| | | | | - Does not descend into class and module defs - Adds several tests, including tests for if-else
* Resolve feature warningsphaller2012-11-121-1/+1
|
* Reduce visibility of members of ExprBuilderphaller2012-11-121-3/+2
|
* Fix doc comment of awaitphaller2012-11-121-7/+7
|
* Add a test to interrogate the expanded tree.Jason Zaugg2012-11-111-1/+1
| | | | | | | - 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-80/+78
|