| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
During the ANF transform, we were generating a tree of the shape:
{
val temp: Unit = await(futureOfUnit)
temp
()
}
I tried to simplifiy this to avoid creating the temporary value,
but this proved difficult as it would have required changes to
the subsequent state machine transformation.
Even replacing `temp` with `()` made the state machine transform
harder.
So for now, I've just inserted `temp.asInstanceOf[Unit]` to hide
from the compiler warning.
Fixes #74
|
|\
| |
| | |
Avoid masking real errors with NotImplemented awaiting Future[Nothing]
|
|/
|
|
|
|
| |
This commit disabled live variable analysis for intermediate values of type Nothing.
Fixes #104
|
|\
| |
| | |
(noop) Merge 2.10.x to master
|
|/|
| |
| |
| | |
merge/2.10.x-to-master-20150706
|
| |\
| | |
| | | |
Fix compiler crash with value class in result position
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We were leaking untyped trees out of the macro, which crashed
in refchecks.
This commit proactively typechecks the tree returned by `mkZero`.
(cherry picked from commit f4275e22e000541eb619808723b70bd64b9b4873)
|
| |/ |
|
| |\
| | |
| | | |
Bump to 0.9.4-SNAPSHOT
|
| |/ |
|
|\ \
| | |
| | | |
Bump to Scala 2.11.6
|
|/ / |
|
|\ \
| | |
| | | |
Fix compiler crash with value class in result position
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We were leaking untyped trees out of the macro, which crashed
in refchecks.
This commit proactively typechecks the tree returned by `mkZero`.
|
|/ / |
|
|\ \
| | |
| | | |
Merge 2.10.x to master to bring in tag driven publishing
|
|/| |
| |/
| |
| |
| |
| |
| | |
merge/2.10.x-to-master-tag-driven-release
Conflicts:
.travis.yml
|
| |\
| | |
| | | |
Support tag driven publishing
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I started with:
https://github.com/scala/scala-swing/commit/a6a8e1d77e#diff-3acefdae08499733e855dd23e1af933dR8
And:
- modified the regex that derives the version from the tag to
handle the fact we have the scala binary version appended to
our tags
- Removed unnessary cross building with Scala 2.11 (as this is
on the 2.10.x branch)
- generated a key pair for the async repository
- added passphrase for that key, and sonatype credentials, to
sensitive.sbt
- encrypted the secrets with the travis key.
|
|\ \
| | |
| | | |
Merge/2.10.x to master 20141219
|
|/| |
| |/
| |
| |
| |
| |
| |
| |
| | |
merge/2.10.x-to-master-20141219
Conflicts:
src/main/scala/scala/async/internal/AsyncTransform.scala
src/main/scala/scala/async/internal/ExprBuilder.scala
src/test/scala/scala/async/TreeInterrogation.scala
|
| |\
| | |
| | | |
Make `f(await(completedFuture))` execute `f` synchronously
|
| | |
| | |
| | |
| | |
| | |
| | | |
A worthy optimization, suggested by @danarmak.
Closes #73
|
| | | |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, as sequence of state transitions that did not pass through
an asynchrous boundary incurred stack frames. The trivial loop in
the enclosed test case would then overflow the stack.
This commit merges the `resume` and `apply(tr: Try[Any])` methods into
a `apply`. It changes the body of this method to be an infinite loop
with returns at the terminal points in the state machine (or at a
terminal failure.)
To allow merging of these previously separate matches, states that
contain an await are now allocated two state ids: one for the setup
code that calls `onComplete`, and one for the code in the continuation
that records the result and advances the state machine.
Fixes #93
|
| |\
| | |
| | | |
Avoid assigning null to vars of derived value type
|
|\ \ \
| | | |
| | | | |
Fix regression around await of non-class type
|
|/ / /
| | |
| | |
| | | |
E.g. type param, abstrat type.
|
|\ \ \
| | | |
| | | | |
Merge 2.10.x to master (plus a test)
|
| | | | |
|
|/| | |
| | |/
| |/|
| | |
| | |
| | |
| | | |
Conflicts:
src/main/scala/scala/async/internal/AnfTransform.scala
src/main/scala/scala/async/internal/AsyncTransform.scala
src/test/scala/scala/async/run/toughtype/ToughType.scala
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`TreeGen#mkZero` returns `q"null"` for derived value classes.
```
scala> class V(val a: String) extends AnyVal
defined class V
scala> showRaw(gen.mkZero(typeOf[V]))
res0: String = Literal(Constant(null))
```
We use this API in async to generate the initial value for
ANF-lifted temporary variables.
However, this leads to NPEs, as after posterasure, we call the
unbox method on a null reference:
```
% cat sandbox/Macro.scala; scalac-hash v2.10.4 sandbox/Macro.scala; scala-hash v2.10.4 -e 'val x = Macros.myMacro'
import scala.reflect.macros.Context
import scala.language.experimental.macros
object Macros {
def macroImpl(c: Context): c.Expr[C] = {
import c.universe._
val e1 = c.Expr[C](Literal(Constant(null)).setType(typeOf[C]))
reify(e1.splice.asInstanceOf[C @annotation.unchecked.uncheckedVariance])
}
def myMacro: C = macro macroImpl
}
class C(val a: String) extends AnyVal
java.lang.NullPointerException
at Main$$anon$1.<init>(scalacmd4059893593754060829.scala:1)
at Main$.main(scalacmd4059893593754060829.scala:1)
at Main.main(scalacmd4059893593754060829.scala)
```
This commit installs a custom version of `mkZero` that instead
returns `q"new C[$..targs](${mkZero(wrappedType)})`.
Thanks to @ewiner for pinpointing the problem.
|
| | |
|
| | |
|
|\| |
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Test case for already-fixed NPE with value classes
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This progressed along with the fix for #66.
`TreeGen.mkZero` is a bit of a minefield: first with `Nothing` and
now with Value Classes. I wonder if we can provoke the same sort of
bug in the compiler in places where this is used.
Closes #83
|
|\ \
| | |
| | | |
Merge 2.10.x to master
|
|/| |
| |/
| |
| |
| |
| |
| |
| | |
merge/2.10.x-to-master-20140721
Conflicts:
src/main/scala/scala/async/internal/AsyncTransform.scala
src/main/scala/scala/async/internal/Lifter.scala
|
| |\
| | |
| | | |
Fix regression around type skolems and if exprs.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If we start with:
async({
val res = await[S[_$1 with String]](s);
if (true)
await[Int](0)
res
})
Typechecking the application (before macro expansion) yields
(where the trees are printed in the form `expr{tpe}`):
async[S[_$1#5738 with String#137]]({
val res: S[_$1#5490 with String] forSome { type _$1#5490 } =
await[S[_$1#5487 with String]](
s{S[_$1#5487 with String]}
){S[_$1#5487 with String]};
if (true)
await(0)
else
()
res{S[_$1#5738 with String]}
}{S[_$1#5738 with String]}){S[_$1#5738 with String]}
Note that the type of the second last line contains a skolemized
symbol `_$1#5738` of the existential `_$1#5490`. This is created
by this case in `Typer#adapt`:
case et @ ExistentialType(_, _) if ((mode & (EXPRmode | LHSmode)) == EXPRmode) =>
adapt(tree setType et.skolemizeExistential(context.owner, tree), mode, pt, original)
Our ANF rewrites part of this code to:
<synthetic> val await$1: S[_$1#5487 with String] = await[S[_$1#5487 with String]](awaitable$1);
val res: S[_$1#5490 with String] forSome { type _$1 } = await$1;
And later, the state machine transformation splits the last line into
a blank field and an assignment. Typechecking the `Assign` node
led to the an type error.
This commit manually attributes the types to the `Assign` node so
as to avoid these problem.
It also reigns in an overeager rewriting of `If` nodes in the
ANF transform, which was due to a bug in the label detection
logic introduced in 4fc5463538.
Thanks to @gnovark for yet another devilish test case and
analysis of the problem with label detection.
I worked on a more principled fix on:
https://github.com/retronym/async/compare/ticket/79-2?expand=1
in which I try to use `repackExistential` to convert skolemized
types to existentials for use as the types of synthetic vals
introduced by the ANF transform. This ran into a deeper problem
with existential subtyping in the compiler itself though.
|
| |\ \
| | | |
| | | | |
Fix asymptotic performance issues in live variables analysis.
|
| | |/
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fix possibly-exponential runtime for DFS graph searches.
Improve DFA fixpoint algorithm to correctly compute worklist
of only changed nodes for each iteration.
Added test that takes > 2 minutes to compile without these
improvements.
|
| |\ \
| | |/
| |/| |
Avoid NotImplementedError awaiting a Future[Nothing]
|
| |/
| |
| |
| |
| |
| |
| | |
`gen.mkZero(NothingTpe)` gives the tree `Predef.???`. Instead, we should leave
the `await` field uninitialized with `ValDef(..., rhs = EmptyTree)`.
Fixes #66
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Added the missed s
|