Skip to content

Commit d1ecc22

Browse files
committed
Address review comments #774
1 parent 56b1951 commit d1ecc22

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/dotty/tools/dotc/transform/Constructors.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ class Constructors extends MiniPhaseTransform with SymTransformer { thisTransfor
4141
// 3. It is accessed on an object other than `this`
4242
// 4. It is a mutable parameter accessor
4343
// 5. It is has a wildcard initializer `_`
44-
private var retainedPrivateVals = mutable.Set[Symbol]()
45-
private var seenPrivateVals = mutable.Set[Symbol]()
46-
private var insideConstructor = false
44+
private val retainedPrivateVals = mutable.Set[Symbol]()
45+
private val seenPrivateVals = mutable.Set[Symbol]()
4746

4847
private def markUsedPrivateSymbols(tree: RefTree)(implicit ctx: Context): Unit = {
4948

@@ -63,7 +62,6 @@ class Constructors extends MiniPhaseTransform with SymTransformer { thisTransfor
6362
if (inConstructor && (sym.is(ParamAccessor) || seenPrivateVals.contains(sym))) {
6463
// used inside constructor, accessed on this,
6564
// could use constructor argument instead, no need to retain field
66-
println("hoha")
6765
}
6866
else retain
6967
case _ => retain
@@ -81,7 +79,6 @@ class Constructors extends MiniPhaseTransform with SymTransformer { thisTransfor
8179
tree
8280
}
8381

84-
8582
override def transformValDef(tree: tpd.ValDef)(implicit ctx: Context, info: TransformerInfo): tpd.Tree = {
8683
if (mightBeDropped(tree.symbol))
8784
(if (isWildcardStarArg(tree.rhs)) retainedPrivateVals else seenPrivateVals) += tree.symbol

0 commit comments

Comments
 (0)