| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
- 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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Works on the 2.10.x branch, so just backprting the test.
Cherry picked from 6f6546ebfc26564843621e79d840209a5103d3c8.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Unhardcode use of scala.util.Try
|
|/
|
|
| |
In favour of the type defined by the active FutureSystem.
|
|\
| |
| | |
Update TODO comment about pres. compiler friendliness.
|
| | |
|
|\ \
| |/
|/| |
Update copyright years.
|
|/
|
|
| |
2013 must have been unlucky.
|
|\
| |
| | |
Minor fixes in Async`s scaladoc.
|
|/ |
|
|\
| |
| | |
Fix line numbers for example in README
|
| | |
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Another take at the 2.10/2.11 spanning suppressMacroAttachment
|
| | |
| | |
| | |
| | | |
It was only working on the former.
|
|\ \ \
| | | |
| | | | |
Fix crashers in do/while and while(await(..))
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| |/ /
|/| | |
Remove unsupported Oracle JDK6 from Travis CI config
|
|/ / |
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Hooks for custom async implementations
|
| | |
| | |
| | |
| | |
| | | |
Custom implementation of the async macro may choose to use
a different data type to represent `Throwable | A`.
|
| | |
| | |
| | |
| | | |
For use by custom implementations of the async macro.
|
|\ \ \
| | | |
| | | | |
Presentation compiler friendliness
|
| | | |
| | | |
| | | |
| | | | |
"There's a method for that!"
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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:
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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)
|
|/ / /
| | |
| | | |
Fixes #45
|
|\ \ \
| | | |
| | | | |
Clean-ups found during review of PR #43
|
|/ / / |
|
|\ \ \
| | | |
| | | | |
Fix crasher in icode due to symbol mismatches in lifted methods
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|/ /
| |
| | |
Link to CI status
|
|\ \
| | |
| | | |
Enable Travis CI
|
| | | |
|