@@ -45,9 +45,9 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
45
45
final val shortenImports = false
46
46
47
47
// All typechecked RHS of ValDefs for right-associative operator desugaring
48
- val rightAssocValDefs = new mutable.AnyRefMap [Symbol , Tree ]
48
+ private val rightAssocValDefs = new mutable.AnyRefMap [Symbol , Tree ]
49
49
// Symbols of ValDefs for right-associative operator desugaring which are passed by name and have been inlined
50
- val inlinedRightAssocValDefs = new mutable.HashSet [Symbol ]
50
+ private val inlinedRightAssocValDefs = new mutable.HashSet [Symbol ]
51
51
52
52
// allows override of the behavior of the resetTyper method w.r.t comments
53
53
def resetDocComments () = {
@@ -2071,7 +2071,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
2071
2071
transformedOrTyped(vdef.rhs, EXPRmode | BYVALmode , tpt2)
2072
2072
}
2073
2073
val vdef1 = treeCopy.ValDef (vdef, typedMods, sym.name, tpt1, checkDead(rhs1)) setType NoType
2074
- if (sym.isSynthetic && sym.name.toString. startsWith(nme.RIGHT_ASSOC_OP_PREFIX ))
2074
+ if (sym.isSynthetic && sym.name.startsWith(nme.RIGHT_ASSOC_OP_PREFIX ))
2075
2075
rightAssocValDefs += ((sym, vdef1.rhs))
2076
2076
vdef1
2077
2077
}
@@ -2486,7 +2486,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
2486
2486
2487
2487
// Remove ValDef for right-associative by-value operator desugaring which has been inlined into expr1
2488
2488
val statsTyped2 = statsTyped match {
2489
- case (vd : ValDef ) :: Nil if inlinedRightAssocValDefs contains vd.symbol => Nil
2489
+ case (vd : ValDef ) :: Nil if inlinedRightAssocValDefs remove vd.symbol => Nil
2490
2490
case _ => statsTyped
2491
2491
}
2492
2492
@@ -3611,7 +3611,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
3611
3611
val args2 = (args1, mt.params) match {
3612
3612
case ((ident : Ident ) :: Nil , param :: Nil ) if param.isByNameParam && rightAssocValDefs.contains(ident.symbol) =>
3613
3613
inlinedRightAssocValDefs += ident.symbol
3614
- val rhs = rightAssocValDefs(ident.symbol)
3614
+ val rhs = rightAssocValDefs.remove (ident.symbol).get
3615
3615
rhs.changeOwner(ident.symbol -> context.owner) :: Nil
3616
3616
case _ => args1
3617
3617
}
0 commit comments