@@ -2140,14 +2140,14 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
2140
2140
private def typeparamCorrespondsToField (tycon : Type , tparam : TypeParamInfo ): Boolean =
2141
2141
productSelectorTypes(tycon, null ).exists {
2142
2142
case tp : TypeRef =>
2143
- ( tp.designator: Any ) == tparam // Bingo!
2143
+ tp.designator.eq( tparam) // Bingo!
2144
2144
case _ =>
2145
2145
false
2146
2146
}
2147
2147
2148
2148
/** Is `tp` an empty type?
2149
2149
*
2150
- * `true` implies that we found a proof; uncertainty default to `false`.
2150
+ * `true` implies that we found a proof; uncertainty defaults to `false`.
2151
2151
*/
2152
2152
def provablyEmpty (tp : Type ): Boolean =
2153
2153
tp.dealias match {
@@ -2156,9 +2156,9 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
2156
2156
case OrType (tp1, tp2) => provablyEmpty(tp1) && provablyEmpty(tp2)
2157
2157
case at @ AppliedType (tycon, args) =>
2158
2158
args.lazyZip(tycon.typeParams).exists { (arg, tparam) =>
2159
- tparam.paramVariance >= 0 &&
2160
- provablyEmpty(arg) &&
2161
- typeparamCorrespondsToField(tycon, tparam)
2159
+ tparam.paramVariance >= 0
2160
+ && provablyEmpty(arg)
2161
+ && typeparamCorrespondsToField(tycon, tparam)
2162
2162
}
2163
2163
case tp : TypeProxy =>
2164
2164
provablyEmpty(tp.underlying)
@@ -2168,7 +2168,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
2168
2168
2169
2169
/** Are `tp1` and `tp2` provablyDisjoint types?
2170
2170
*
2171
- * `true` implies that we found a proof; uncertainty default to `false`.
2171
+ * `true` implies that we found a proof; uncertainty defaults to `false`.
2172
2172
*
2173
2173
* Proofs rely on the following properties of Scala types:
2174
2174
*
@@ -2178,7 +2178,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
2178
2178
* 4. There is no value of type Nothing
2179
2179
*
2180
2180
* Note on soundness: the correctness of match types relies on on the
2181
- * property that in all possible contexts, a same match type expression
2181
+ * property that in all possible contexts, the same match type expression
2182
2182
* is either stuck or reduces to the same case.
2183
2183
*/
2184
2184
def provablyDisjoint (tp1 : Type , tp2 : Type )(implicit ctx : Context ): Boolean = {
@@ -2221,8 +2221,8 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
2221
2221
else
2222
2222
false
2223
2223
case (AppliedType (tycon1, args1), AppliedType (tycon2, args2)) if tycon1 == tycon2 =>
2224
- // It is possible to conclude that two types applies are disjoints by
2225
- // looking at covariant type parameters if The said type parameters
2224
+ // It is possible to conclude that two types applies are disjoint by
2225
+ // looking at covariant type parameters if the said type parameters
2226
2226
// are disjoin and correspond to fields.
2227
2227
// (Type parameter disjointness is not enough by itself as it could
2228
2228
// lead to incorrect conclusions for phantom type parameters).
0 commit comments