File tree 1 file changed +2
-5
lines changed
src/dotty/tools/dotc/transform
1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,8 @@ class Constructors extends MiniPhaseTransform with SymTransformer { thisTransfor
41
41
// 3. It is accessed on an object other than `this`
42
42
// 4. It is a mutable parameter accessor
43
43
// 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 ]()
47
46
48
47
private def markUsedPrivateSymbols (tree : RefTree )(implicit ctx : Context ): Unit = {
49
48
@@ -63,7 +62,6 @@ class Constructors extends MiniPhaseTransform with SymTransformer { thisTransfor
63
62
if (inConstructor && (sym.is(ParamAccessor ) || seenPrivateVals.contains(sym))) {
64
63
// used inside constructor, accessed on this,
65
64
// could use constructor argument instead, no need to retain field
66
- println(" hoha" )
67
65
}
68
66
else retain
69
67
case _ => retain
@@ -81,7 +79,6 @@ class Constructors extends MiniPhaseTransform with SymTransformer { thisTransfor
81
79
tree
82
80
}
83
81
84
-
85
82
override def transformValDef (tree : tpd.ValDef )(implicit ctx : Context , info : TransformerInfo ): tpd.Tree = {
86
83
if (mightBeDropped(tree.symbol))
87
84
(if (isWildcardStarArg(tree.rhs)) retainedPrivateVals else seenPrivateVals) += tree.symbol
You can’t perform that action at this time.
0 commit comments