diff options
author | Martin Odersky <odersky@gmail.com> | 2015-05-31 13:14:49 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-06-01 15:04:46 +0200 |
commit | 9b85e308cfae87b9decd13ac4862668e7720648e (patch) | |
tree | 6e4c87ae44ddbddd1fd1afb9b0a28621bb4cfc62 /src | |
parent | 0b34395ab28180d6e3fcd621e399d840f8303714 (diff) | |
download | dotty-9b85e308cfae87b9decd13ac4862668e7720648e.tar.gz dotty-9b85e308cfae87b9decd13ac4862668e7720648e.tar.bz2 dotty-9b85e308cfae87b9decd13ac4862668e7720648e.zip |
Make elimWildcardIdents apply to Assignments
Fixes junit failure in dotty where a lazy val was initialized with
a "...$lazy = _" assignment.
Moved ElimWiildcard to one group before. It does not really matter where it goes
so it might as well go someshere in the middle of the pack.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/Compiler.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/transform/ElimWildcardIdents.scala | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/Compiler.scala b/src/dotty/tools/dotc/Compiler.scala index 0f0da76ee..8b0e08a4c 100644 --- a/src/dotty/tools/dotc/Compiler.scala +++ b/src/dotty/tools/dotc/Compiler.scala @@ -71,12 +71,12 @@ class Compiler { List(new LambdaLift, // in this mini-phase block scopes are incorrect. No phases that rely on scopes should be here new Flatten, new ElimStaticThis, + new ElimWildcardIdents, new RestoreScopes), List(/*new PrivateToStatic,*/ new ExpandPrivate, new CollectEntryPoints, new LabelDefs, - new ElimWildcardIdents, new TraitConstructors), List(new GenBCode) ) diff --git a/src/dotty/tools/dotc/transform/ElimWildcardIdents.scala b/src/dotty/tools/dotc/transform/ElimWildcardIdents.scala index 29194d235..300f468f6 100644 --- a/src/dotty/tools/dotc/transform/ElimWildcardIdents.scala +++ b/src/dotty/tools/dotc/transform/ElimWildcardIdents.scala @@ -29,6 +29,9 @@ class ElimWildcardIdents extends MiniPhaseTransform { recur(tree) } + override def transformAssign(tree: tpd.Assign)(implicit ctx: Context, info: TransformerInfo): tpd.Tree = + cpy.Assign(tree)(tree.lhs, wildcardToDefaultValue(tree.rhs)) + override def transformValDef(tree: tpd.ValDef)(implicit ctx: Context, info: TransformerInfo): tpd.Tree = cpy.ValDef(tree)(rhs = wildcardToDefaultValue(tree.rhs)) |