diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-08-25 10:45:28 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-08-25 12:55:42 +0200 |
commit | d1ecc22865b201a94a18c6a4f3404ab8bbb5945a (patch) | |
tree | 5b25ac81c8c354ecfdcaae7cffd91b0698c6c4c2 | |
parent | 56b1951b5763a3a77230f8b405e17b2e3ed2c988 (diff) | |
download | dotty-d1ecc22865b201a94a18c6a4f3404ab8bbb5945a.tar.gz dotty-d1ecc22865b201a94a18c6a4f3404ab8bbb5945a.tar.bz2 dotty-d1ecc22865b201a94a18c6a4f3404ab8bbb5945a.zip |
Address review comments #774
-rw-r--r-- | src/dotty/tools/dotc/transform/Constructors.scala | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/transform/Constructors.scala b/src/dotty/tools/dotc/transform/Constructors.scala index 7ba2ccf4d..2f78eb9c6 100644 --- a/src/dotty/tools/dotc/transform/Constructors.scala +++ b/src/dotty/tools/dotc/transform/Constructors.scala @@ -41,9 +41,8 @@ class Constructors extends MiniPhaseTransform with SymTransformer { thisTransfor // 3. It is accessed on an object other than `this` // 4. It is a mutable parameter accessor // 5. It is has a wildcard initializer `_` - private var retainedPrivateVals = mutable.Set[Symbol]() - private var seenPrivateVals = mutable.Set[Symbol]() - private var insideConstructor = false + private val retainedPrivateVals = mutable.Set[Symbol]() + private val seenPrivateVals = mutable.Set[Symbol]() private def markUsedPrivateSymbols(tree: RefTree)(implicit ctx: Context): Unit = { @@ -63,7 +62,6 @@ class Constructors extends MiniPhaseTransform with SymTransformer { thisTransfor if (inConstructor && (sym.is(ParamAccessor) || seenPrivateVals.contains(sym))) { // used inside constructor, accessed on this, // could use constructor argument instead, no need to retain field - println("hoha") } else retain case _ => retain @@ -81,7 +79,6 @@ class Constructors extends MiniPhaseTransform with SymTransformer { thisTransfor tree } - override def transformValDef(tree: tpd.ValDef)(implicit ctx: Context, info: TransformerInfo): tpd.Tree = { if (mightBeDropped(tree.symbol)) (if (isWildcardStarArg(tree.rhs)) retainedPrivateVals else seenPrivateVals) += tree.symbol |