diff options
author | Martin Odersky <odersky@gmail.com> | 2015-04-23 15:20:25 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-04-30 14:26:05 +0200 |
commit | bcc6bf711d2a0110db7c9dc091a8e81697ae6a3c (patch) | |
tree | 83f6a5c4168b0473c45eec49fa8b764ed2f822bf /src | |
parent | 979ee0ff41c2a957b22e886ea43ad4f070a9777d (diff) | |
download | dotty-bcc6bf711d2a0110db7c9dc091a8e81697ae6a3c.tar.gz dotty-bcc6bf711d2a0110db7c9dc091a8e81697ae6a3c.tar.bz2 dotty-bcc6bf711d2a0110db7c9dc091a8e81697ae6a3c.zip |
Remove dead code in Constructors
The intoConstr method is never called with argument inSuperCall = true.
So code dependent on it can be dropped.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/transform/Constructors.scala | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/transform/Constructors.scala b/src/dotty/tools/dotc/transform/Constructors.scala index 6842e14d7..ddd64d500 100644 --- a/src/dotty/tools/dotc/transform/Constructors.scala +++ b/src/dotty/tools/dotc/transform/Constructors.scala @@ -80,11 +80,10 @@ class Constructors extends MiniPhaseTransform with SymTransformer { thisTransfor // (2) If the parameter accessor reference was to an alias getter, // drop the () when replacing by the parameter. object intoConstr extends TreeMap { - private var excluded: FlagSet = _ override def transform(tree: Tree)(implicit ctx: Context): Tree = tree match { case Ident(_) | Select(This(_), _) => var sym = tree.symbol - if (sym is (ParamAccessor, butNot = excluded)) sym = sym.subst(accessors, paramSyms) + if (sym is (ParamAccessor, butNot = Mutable)) sym = sym.subst(accessors, paramSyms) if (sym.owner.isConstructor) ref(sym).withPos(tree.pos) else tree case Apply(fn, Nil) => val fn1 = transform(fn) @@ -95,8 +94,7 @@ class Constructors extends MiniPhaseTransform with SymTransformer { thisTransfor if (noDirectRefsFrom(tree)) tree else super.transform(tree) } - def apply(tree: Tree, prevOwner: Symbol, inSuperCall: Boolean = false)(implicit ctx: Context): Tree = { - this.excluded = if (inSuperCall) EmptyFlags else Mutable + def apply(tree: Tree, prevOwner: Symbol)(implicit ctx: Context): Tree = { transform(tree).changeOwnerAfter(prevOwner, constr.symbol, thisTransform) } } |