@@ -2693,6 +2693,17 @@ object Types {
2693
2693
}
2694
2694
}
2695
2695
2696
+ /** A type lambda of the form `[X_0 B_0, ..., X_n B_n] => T`
2697
+ * Variances are encoded in parameter names. A name starting with `+`
2698
+ * designates a covariant parameter, a name starting with `-` designates
2699
+ * a contravariant parameter, and every other name designates a non-variant parameter.
2700
+ *
2701
+ * @param paramNames The names `X_0`, ..., `X_n`
2702
+ * @param paramInfosExp A function that, given the polytype itself, returns the
2703
+ * parameter bounds `B_1`, ..., `B_n`
2704
+ * @param resultTypeExp A function that, given the polytype itself, returns the
2705
+ * result type `T`.
2706
+ */
2696
2707
class HKTypeLambda (val paramNames : List [TypeName ])(
2697
2708
paramInfosExp : HKTypeLambda => List [TypeBounds ], resultTypeExp : HKTypeLambda => Type )
2698
2709
extends HKLambda with TypeLambda {
@@ -2708,18 +2719,8 @@ object Types {
2708
2719
protected def prefixString = " HKTypeLambda"
2709
2720
}
2710
2721
2711
- /** A type lambda of the form `[X_0 B_0, ..., X_n B_n] => T`
2712
- * This is used both as a type of a polymorphic method and as a type of
2713
- * a higher-kinded type parameter. Variances are encoded in parameter
2714
- * names. A name starting with `+` designates a covariant parameter,
2715
- * a name starting with `-` designates a contravariant parameter,
2716
- * and every other name designates a non-variant parameter.
2717
- *
2718
- * @param paramNames The names `X_0`, ..., `X_n`
2719
- * @param paramInfosExp A function that, given the polytype itself, returns the
2720
- * parameter bounds `B_1`, ..., `B_n`
2721
- * @param resultTypeExp A function that, given the polytype itself, returns the
2722
- * result type `T`.
2722
+ /** The type of a polymorphic method. It has the same form as HKTypeLambda,
2723
+ * except it applies to terms and parameters do not have variances.
2723
2724
*/
2724
2725
class PolyType (val paramNames : List [TypeName ])(
2725
2726
paramInfosExp : PolyType => List [TypeBounds ], resultTypeExp : PolyType => Type )
0 commit comments