@@ -1149,15 +1149,15 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
1149
1149
*
1150
1150
* flip(T) <: flip(U)
1151
1151
*
1152
- * where `flip` changes top-level contravariant type aliases to covariant ones.
1153
- * Intuitively `<:s` means subtyping `<:`, except that all top-level arguments
1152
+ * where `flip` changes covariant occurrences of contravariant type parameters to
1153
+ * covariant ones. Intuitively `<:s` means subtyping `<:`, except that all arguments
1154
1154
* to contravariant parameters are compared as if they were covariant. E.g. given class
1155
1155
*
1156
1156
* class Cmp[-X]
1157
1157
*
1158
- * `Cmp[T] <:s Cmp[U]` if `T <: U`. On the other hand, nested occurrences
1159
- * of parameters are not affected.
1160
- * So `T <: U` would imply `List[Cmp[U]] <:s List[Cmp[T]]`, as usual .
1158
+ * `Cmp[T] <:s Cmp[U]` if `T <: U`. On the other hand, non-variant occurrences
1159
+ * of parameters are not affected. So `T <: U` would imply `Set[Cmp[U]] <:s Set[Cmp[T]]`,
1160
+ * as usual, because `Set` is non-variant .
1161
1161
*
1162
1162
* This relation might seem strange, but it models closely what happens for methods.
1163
1163
* Indeed, if we integrate the existing rules for methods into `<:s` we have now that
@@ -1174,7 +1174,6 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
1174
1174
else {
1175
1175
val flip = new TypeMap {
1176
1176
def apply (t : Type ) = t match {
1177
- case t : TypeBounds => t
1178
1177
case t @ AppliedType (tycon, args) =>
1179
1178
def mapArg (arg : Type , tparam : TypeParamInfo ) =
1180
1179
if (variance > 0 && tparam.paramVariance < 0 ) defn.FunctionOf (arg :: Nil , defn.UnitType )
0 commit comments