diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2016-09-08 15:23:22 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2016-09-08 15:44:04 +1000 |
commit | 6bf20ee474afa46564899e9f57065ad1f22fabed (patch) | |
tree | 042f9a73f036191ae5b8178ebd3846b05eade760 /src/main/scala/scala/async/internal/TransformUtils.scala | |
parent | 4395afe0ab7c59f088607d0849abe48b0f83265d (diff) | |
download | scala-async-6bf20ee474afa46564899e9f57065ad1f22fabed.tar.gz scala-async-6bf20ee474afa46564899e9f57065ad1f22fabed.tar.bz2 scala-async-6bf20ee474afa46564899e9f57065ad1f22fabed.zip |
Compatibility with Scala 2.12.0-RC1
- method local lazy vals are now encoded as a single ValDef
rather than a ValDef + DefDef pair. We need to treat ValDef-s
with the LAZY flag in the same way as we used to treat the
DefDef.
- Rename one of the symbols `ANF,anf` in the same scope to avoid
generating anonymous class names that differ only in case. The
compiler warned about this one.
- When patching the LabelDefs to have a `Unit` result type, propagate
this other LabelDefs conclude with a jump to that label. Not sure
why, but without this we now hit an error in the backend about the
nonsensical attempt to emit a coercion from void to int.
- Use crossScalaVersions in the build and update the Scala versions
tested in CI.
Diffstat (limited to 'src/main/scala/scala/async/internal/TransformUtils.scala')
-rw-r--r-- | src/main/scala/scala/async/internal/TransformUtils.scala | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/scala/scala/async/internal/TransformUtils.scala b/src/main/scala/scala/async/internal/TransformUtils.scala index 2999be2..8b94513 100644 --- a/src/main/scala/scala/async/internal/TransformUtils.scala +++ b/src/main/scala/scala/async/internal/TransformUtils.scala @@ -479,6 +479,14 @@ private[async] trait TransformUtils { typingTransform(t, owner) { (tree, api) => tree match { + case LabelDef(name, params, rhs) => + val rhs1 = api.recur(rhs) + if (rhs1.tpe =:= UnitTpe) { + internal.setInfo(tree.symbol, internal.methodType(tree.symbol.info.paramLists.head, UnitTpe)) + treeCopy.LabelDef(tree, name, params, rhs1) + } else { + treeCopy.LabelDef(tree, name, params, rhs1) + } case Block(stats, expr) => val stats1 = stats map api.recur val expr1 = api.recur(expr) |