@@ -38,7 +38,7 @@ class InlineCaseIntrinsics(implicit val ctx: Context) extends Optimisation {
38
38
case _ => fun
39
39
}
40
40
val constructor = a.symbol.owner.companionClass.primaryConstructor.asTerm
41
- evalReciever (a, rollInArgs(argss.tail, New (a.tpe.widenDealias, constructor, argss.head)))
41
+ evalreceiver (a, rollInArgs(argss.tail, New (a.tpe.widenDealias, constructor, argss.head)))
42
42
43
43
// For synthetic dotty unapplies on case classes:
44
44
// - CC.unapply(arg): CC → arg
@@ -60,10 +60,10 @@ class InlineCaseIntrinsics(implicit val ctx: Context) extends Optimisation {
60
60
if (isDottyUnapply) { // dotty only
61
61
if (a.tpe.derivesFrom(defn.BooleanClass ))
62
62
// CC.unapply(arg): Boolean → true
63
- evalReciever (a, Literal (Constant (true )))
63
+ evalreceiver (a, Literal (Constant (true )))
64
64
else
65
65
// CC.unapply(arg): CC → arg
66
- evalReciever (a, a.args.head)
66
+ evalreceiver (a, a.args.head)
67
67
}
68
68
else if (isScalaOptionUnapply) {
69
69
// CC.unapply(arg): Option[CC] → new Some(new scala.TupleN(arg._1, ..., arg._N))
@@ -82,7 +82,7 @@ class InlineCaseIntrinsics(implicit val ctx: Context) extends Optimisation {
82
82
val none = ref(defn.NoneModuleRef )
83
83
def isNull (e : Tree ) = e.select(defn.Object_eq ).appliedTo(Literal (Constant (null )))
84
84
def fi (e : Tree ) = If (isNull(e), none, some(e))
85
- evalReciever (a, evalOnce(a.args.head)(fi))
85
+ evalreceiver (a, evalOnce(a.args.head)(fi))
86
86
}
87
87
else a
88
88
@@ -93,28 +93,28 @@ class InlineCaseIntrinsics(implicit val ctx: Context) extends Optimisation {
93
93
a.symbol.extendedOverriddenSymbols.isEmpty &&
94
94
(isPureExpr(a.fun) || a.fun.symbol.is(Synthetic )) =>
95
95
96
- def reciever (t : Tree ): Type = t match {
97
- case t : Apply => reciever (t.fun)
98
- case t : TypeApply => reciever (t.fun)
96
+ def receiver (t : Tree ): Type = t match {
97
+ case t : Apply => receiver (t.fun)
98
+ case t : TypeApply => receiver (t.fun)
99
99
case t : Ident => desugarIdent(t) match {
100
- case Some (t) => reciever (t)
100
+ case Some (t) => receiver (t)
101
101
case _ => NoType
102
102
}
103
103
case t : Select => t.qualifier.tpe.widenDealias
104
104
}
105
105
106
- val recv = reciever (a)
106
+ val recv = receiver (a)
107
107
if (recv.typeSymbol.is(Module )) {
108
108
val someTpe = a.tpe.translateParameterized(defn.OptionClass , defn.SomeClass )
109
- evalReciever (a, New (someTpe, a.args.head :: Nil ))
109
+ evalreceiver (a, New (someTpe, a.args.head :: Nil ))
110
110
}
111
111
else a
112
112
case t => t
113
113
}
114
114
115
115
// Apply fun may be a side-effectful function. E.g. a block, see tests/run/t4859.scala
116
116
// we need to maintain expressions that were in this block
117
- def evalReciever (a : Apply , res : Tree ) = {
117
+ def evalreceiver (a : Apply , res : Tree ) = {
118
118
def receiver (t : Tree ): Tree = t match {
119
119
case TypeApply (fun, targs) if fun.symbol eq t.symbol => receiver(fun)
120
120
case Apply (fn, args) if fn.symbol == t.symbol => receiver(fn)
0 commit comments