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