@@ -67,9 +67,9 @@ trait Deriving {
6767 * the deriving ADT
6868 * (b) a single parameter type class with a parameter of kind * and an ADT with
6969 * one or more type parameter of kind *
70- * (c) the Eql type class
70+ * (c) the CanEqual type class
7171 *
72- * See detailed descriptions in deriveSingleParameter and deriveEql below.
72+ * See detailed descriptions in deriveSingleParameter and deriveCanEqual below.
7373 *
7474 * If it passes the checks, enter a type class instance for it in the current scope.
7575 *
@@ -145,7 +145,7 @@ trait Deriving {
145145 //
146146 // given derived$TC[a, b, c] given TC[a], TC[b], TC[c]: TC[a, b, c]
147147 //
148- // This, like the derivation for Eql , is a special case of the
148+ // This, like the derivation for CanEqual , is a special case of the
149149 // earlier more general multi-parameter type class model for which
150150 // the heuristic is typically a good one.
151151
@@ -185,8 +185,8 @@ trait Deriving {
185185 cannotBeUnified
186186 }
187187
188- def deriveEql : Unit = {
189- // Specific derives rules for the Eql type class ... (c) above
188+ def deriveCanEqual : Unit = {
189+ // Specific derives rules for the CanEqual type class ... (c) above
190190 //
191191 // This has been extracted from the earlier more general multi-parameter
192192 // type class model. Modulo the assumptions below, the implied semantics
@@ -196,26 +196,26 @@ trait Deriving {
196196 // 1. Type params of the deriving class correspond to all and only
197197 // elements of the deriving class which are relevant to equality (but:
198198 // type params could be phantom, or the deriving class might have an
199- // element of a non-Eql type non-parametrically).
199+ // element of a non-CanEqual type non-parametrically).
200200 //
201201 // 2. Type params of kinds other than * can be assumed to be irrelevant to
202202 // the derivation (but: eg. Foo[F[_]](fi: F[Int])).
203203 //
204204 // Are they reasonable? They cover some important cases (eg. Tuples of all
205- // arities). derives Eql is opt-in, so if the semantics don't match those
205+ // arities). derives CanEqual is opt-in, so if the semantics don't match those
206206 // appropriate for the deriving class the author of that class can provide
207207 // their own instance in the normal way. That being so, the question turns
208208 // on whether there are enough types which fit these semantics for the
209209 // feature to pay its way.
210210
211211 // Procedure:
212212 // We construct a two column matrix of the deriving class type parameters
213- // and the Eql type class parameters.
213+ // and the CanEqual type class parameters.
214214 //
215215 // Rows: parameters of the deriving class
216- // Columns: parameters of the Eql type class (L/R)
216+ // Columns: parameters of the CanEqual type class (L/R)
217217 //
218- // Running example: type class: class Eql [L, R], deriving class: class A[T, U, V]
218+ // Running example: type class: class CanEqual [L, R], deriving class: class A[T, U, V]
219219 // clsParamss =
220220 // T_L T_R
221221 // U_L U_R
@@ -225,15 +225,15 @@ trait Deriving {
225225 tparam.copy(name = s " ${tparam.name}_ $$ _ ${tcparam.name}" .toTypeName)
226226 .asInstanceOf [TypeSymbol ])
227227 }
228- // Retain only rows with L/R params of kind * which Eql can be applied to.
228+ // Retain only rows with L/R params of kind * which CanEqual can be applied to.
229229 // No pairwise evidence will be required for params of other kinds.
230230 val firstKindedParamss = clsParamss.filter {
231231 case param :: _ => ! param.info.isLambdaSub
232232 case _ => false
233233 }
234234
235235 // The types of the required evidence parameters. In the running example:
236- // Eql [T_L, T_R], Eql [U_L, U_R], Eql [V_L, V_R]
236+ // CanEqual [T_L, T_R], CanEqual [U_L, U_R], CanEqual [V_L, V_R]
237237 val evidenceParamInfos =
238238 for (row <- firstKindedParamss)
239239 yield row.map(_.typeRef)
@@ -244,12 +244,12 @@ trait Deriving {
244244 for (n <- List .range(0 , typeClassArity))
245245 yield cls.typeRef.appliedTo(clsParamss.map(row => row(n).typeRef))
246246
247- // Eql [A[T_L, U_L, V_L], A[T_R, U_R, V_R]]
247+ // CanEqual [A[T_L, U_L, V_L], A[T_R, U_R, V_R]]
248248 addInstance(clsParamss.flatten, evidenceParamInfos, instanceTypes)
249249 }
250250
251251 if (typeClassArity == 1 ) deriveSingleParameter
252- else if (typeClass == defn.EqlClass ) deriveEql
252+ else if (typeClass == defn.CanEqualClass ) deriveCanEqual
253253 else if (typeClassArity == 0 )
254254 report.error(i " type ${typeClass.name} in derives clause of ${cls.name} has no type parameters " , derived.srcPos)
255255 else
0 commit comments