aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Refactoring in ANFTransformJason Zaugg2014-04-051-15/+2
| | | | | - simpler means to calculate `applyDepth` - remove unused binder
* Update to Scala 2.11.0-RC4, adapting to change in quasiquotesJason Zaugg2014-04-052-2/+69
| | | | | | | | Namely: https://github.com/scala/scala/pull/3656 I can't find a way to express a QQ that matches an constructor invocation *and* lets me bind a reference to the `New` tree. So I've dropped down to a borrowed version of `TreeInfo#Applied`.
* Incorporate pull request feedbackJason Zaugg2014-03-274-8/+3
| | | | | | | - remove unneeded `setType(NoType)`, which was leftover from my first attempts to find this bug. - fix typo in error message - optimize imports
* Allow lazy vals without await in the initializerJason Zaugg2014-03-274-8/+48
| | | | | | | | | | | | | | | | | | | | 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. Fixes #52
* Fix "not a class" crasher in live variable analysisJason Zaugg2014-03-122-1/+30
| | | | | | Predicate the `asClass` cast with an `isClass` check. Fixes #63
* 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
* AsyncMacro.global is goneEugene Burmako2014-02-159-53/+76
|
* AsyncMacro.macroApplication is goneEugene Burmako2014-02-153-6/+4
|
* callSiteTyper and TypingTransformers are goneEugene Burmako2014-02-152-13/+1
|
* migrates SelectiveAnfTransform to typingTransformEugene Burmako2014-02-151-233/+227
|
* oh God, in-place typechecking!!!Eugene Burmako2014-02-151-1/+1
|
* migrates UseFields to typingTransformEugene Burmako2014-02-151-26/+20
|
* migrates transformAt to typingTransformEugene Burmako2014-02-152-17/+13
|
* replaces mkAttributedCastEugene Burmako2014-02-151-2/+3
|
* gets rid of home-grown changeOwnerEugene Burmako2014-02-153-29/+11
|
* cleans up AnfTransformEugene Burmako2014-02-151-3/+5
|
* cleans up AsyncAnalysisEugene Burmako2014-02-151-1/+1
|
* cleans up AsyncTransformEugene Burmako2014-02-151-2/+2
|
* cleans up ExprBuilderEugene Burmako2014-02-151-1/+1
|
* cleans up FutureSystemEugene Burmako2014-02-154-23/+18
|
* cleans up LifterEugene Burmako2014-02-151-2/+2
|
* cleans up LiveVariablesEugene Burmako2014-02-151-3/+2
|
* eliminates all usages of global in TransformUtilsEugene Burmako2014-02-151-2/+3
|
* removes "import global._" and "def Expr" in TransformUtilsEugene Burmako2014-02-153-16/+14
|
* currentUnit.freshName => c.freshName (leads to less precise tests...)Eugene Burmako2014-02-155-16/+25
|
* abort => c.abortEugene Burmako2014-02-153-7/+4
|
* injects context into AsyncBaseEugene Burmako2014-02-151-3/+5
|
* compat => internalEugene Burmako2014-02-151-3/+2
|
* removes logic that branches on forInteractiveEugene Burmako2014-02-152-30/+4
|
* using compat._ to plug source compatibility breakagesEugene Burmako2014-02-151-2/+3
|
* silences a warning in AsyncAnalysisEugene Burmako2014-02-121-1/+1
|
* toolboxClasspath now works for snapshotsEugene Burmako2014-02-121-0/+2
|
* Unhardcode use of scala.util.TryJason Zaugg2014-01-282-5/+2
| | | | In favour of the type defined by the active FutureSystem.
* Merge pull request #56 from retronym/topic/still-todoJason Zaugg2014-01-141-1/+1
|\ | | | | Update TODO comment about pres. compiler friendliness.
| * Update TODO comment about pres. compiler friendliness.Jason Zaugg2014-01-141-1/+1
| |
* | Update copyright years.Jason Zaugg2014-01-1432-33/+33
|/ | | | 2013 must have been unlucky.
* Minor fixes in Async`s scaladoc.akomar2014-01-121-2/+2
|
* Merge pull request #47 from retronym/topic/pres2Jason Zaugg2013-11-221-6/+5
|\ | | | | Another take at the 2.10/2.11 spanning suppressMacroAttachment
| * Another take at the 2.10/2.11 spanning suppressMacroAttachmentJason Zaugg2013-11-201-6/+5
| | | | | | | | It was only working on the former.
* | Fix crashers in do/while and while(await(..))Jason Zaugg2013-11-225-34/+73
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge pull request #42 from retronym/topic/hooksJason Zaugg2013-11-204-12/+58
|\ | | | | Hooks for custom async implementations
| * Abstract over use of scala.util.TryJason Zaugg2013-11-134-11/+52
| | | | | | | | | | Custom implementation of the async macro may choose to use a different data type to represent `Throwable | A`.
| * Add a hook for post-ANF transformationJason Zaugg2013-11-132-1/+6
| | | | | | | | For use by custom implementations of the async macro.
* | Less hacky check for presentation compiler.Jason Zaugg2013-11-201-1/+1
| | | | | | | | "There's a method for that!"
* | Return original macro application under presentation compiler.Jason Zaugg2013-11-202-7/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now, the body of an async block suffers from diminished IDE support: most notably hyperlinking doesn't work [1]. During the course of the blackbox/whitebox macro discussion, we've often talked about how the former give us the latitude to simply disable macro expansion in the IDE so we could get these features working again, at the cost of losing domain specific errors, such as "await must not be used under a nested function". But why not have our cake and eat too? This commit detects if we are running the presentation compiler and, after running our regular macro, returns the original macro application. We need to annotate that tree to prevent the typechecker from stubbornly calling our macro again. EXPERIMENTAL NOTE: This logic shouldn't live in macros: this is just a short term measure. If these experiments in async prove successful, we'll roll something similar into the macro expansion engine itself. TODO: as a performance optimization, we could just run the "unsupported await" checks, and avoid doing the more expensive state machine transformation. [1] https://www.assembla.com/spaces/scala-ide/tickets/1001449-code-navigation-fails-when-macros-are-used#/activity/ticket:
* | Fix a NPE in the presentation compilerJason Zaugg2013-11-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were using a TypingTransformer and we called `atOwner` before we had called `transform`. This meant that `currTree` was null, which was observed when that was passed to `Context#make`. IDE ticket: https://scala-ide-portfolio.assembla.com/spaces/scala-ide/tickets/1001971#/activity/ticket: Stack trace: exception during macro expansion: java.lang.NullPointerException at scala.tools.nsc.interactive.ContextTrees$class.addContext(ContextTrees.scala:78) at scala.tools.nsc.interactive.Global.addContext(Global.scala:28) at scala.tools.nsc.interactive.Global.registerContext(Global.scala:268) at scala.tools.nsc.typechecker.Contexts$Context.make(Contexts.scala:295) at scala.tools.nsc.typechecker.Contexts$Context.make0(Contexts.scala:320) at scala.tools.nsc.typechecker.Contexts$Context.make(Contexts.scala:327) at scala.tools.nsc.typechecker.Typers$Typer.atOwner(Typers.scala:5662) at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:33) at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:28) at scala.async.internal.AsyncTransform$class.fixup$1(AsyncTransform.scala:191)
* | Clean-ups found during review of PR #43Philipp Haller2013-11-141-10/+2
| |
* | Fix crasher in icode due to symbol mismatches in lifted methodsJason Zaugg2013-11-142-37/+94
|/ | | | | | | | | 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-125-18/+205
| | | | | Once they escape, we leave the references in the state machines fields untouched.
* Remove left-overs of CPS fallback logicPhilipp Haller2013-11-072-5/+3
| | | | Completes removal performed in #37.