@@ -1149,15 +1149,15 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
11491149 *
11501150 * flip(T) <: flip(U)
11511151 *
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
11541154 * to contravariant parameters are compared as if they were covariant. E.g. given class
11551155 *
11561156 * class Cmp[-X]
11571157 *
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 .
11611161 *
11621162 * This relation might seem strange, but it models closely what happens for methods.
11631163 * 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 =>
11741174 else {
11751175 val flip = new TypeMap {
11761176 def apply (t : Type ) = t match {
1177- case t : TypeBounds => t
11781177 case t @ AppliedType (tycon, args) =>
11791178 def mapArg (arg : Type , tparam : TypeParamInfo ) =
11801179 if (variance > 0 && tparam.paramVariance < 0 ) defn.FunctionOf (arg :: Nil , defn.UnitType )
0 commit comments