| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
| |
2013 must have been unlucky.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Once they escape, we leave the references in the state
machines fields untouched.
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
|
| |
We were relying on an internal API that no longer exists.
We also need to tweak the way our tests infer scalaBinaryVersion.
|
|
|
|
|
| |
- Zero out fields of type Any
- Zero out fields of value class type
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
Use @uncheckedBounds to avoid introducing refchecks errors …
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
... 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
|
| |
| |
| |
| |
| | |
These are are at odds with the junit-interface SBT test framework
under SBT 0.13.+, and appear to be superfluous.
|
|/
|
|
|
|
| |
- removed outdated comments in ANF transform
- added a few comments
- removed some unnecessary imports
|
|
|
|
| |
Avoids runtime errors like: "java.lang.Double cannot be cast to scala.runtime.BoxedUnit"
|
| |
|
| |
|
|
|
|
| |
This case already works.
|
| |
|
|
|
|
|
| |
Also support AsyncId.async[Nothing], which was triggering a NPE
in the generated `null.asInstanceOf[Nothing]`.
|
|
|
|
|
| |
When convering If and Match nodes to ANF, set the type to Unit.
Otherwise, erasure might end up casting BoxedUnit to a real type.
|
|
|
|
|
| |
If we intend to keep CPS fallback around for any length of time
it should probably move there too.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
| |
This allows us to cross build against 2.10.x and 2.11.x.
|
|
|
|
|
|
| |
Rather than as @deprecated.
This commit means we can no longer build against 2.10.0.
|
|\
| |
| | |
Allow await in applications with multiple argument lists
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
|
| |
- move all CPS-related code to `continuations` sub package
- fix CPS-based async implementation
- enable testing of CPS-based async implementation
|
|
|
|
| |
This time in the ANF/Inline transformation.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Topic/patmat partial function
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
- 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
|
|/
|
|
|
|
|
|
| |
We need to unwrap and inline `xs`, then
rewrap the result expression with the wildcard
star.
Addresses the first half of #46.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
|
| |
And change TreeInterrogation to set if via this means,
rather than through a direct means, which seems to
assume too much about classloaders.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
}
|
|\
| |
| | |
Port futures tests of scala.concurrent
|
| | |
|
| |
| |
| |
| |
| |
| | |
These tests do not use async/await, yet.
Refs #23
|