aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-03-20 08:52:06 +0100
committerMartin Odersky <odersky@gmail.com>2017-04-06 13:15:29 +0200
commit4939b47bf3c2f74664e3976f23d82987ebf1ab43 (patch)
treef4ea66eb7daafb2b86e2e237089a27bbe1884bd7 /compiler/src/dotty/tools/dotc/core/Types.scala
parentd101f49223ca9b3cf807125fa42af581b729d9ce (diff)
downloaddotty-4939b47bf3c2f74664e3976f23d82987ebf1ab43.tar.gz
dotty-4939b47bf3c2f74664e3976f23d82987ebf1ab43.tar.bz2
dotty-4939b47bf3c2f74664e3976f23d82987ebf1ab43.zip
Update doc comment on HkTypeLambda/PolyType
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/core/Types.scala25
1 files changed, 13 insertions, 12 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala
index 0a23157c8..83fb70aa1 100644
--- a/compiler/src/dotty/tools/dotc/core/Types.scala
+++ b/compiler/src/dotty/tools/dotc/core/Types.scala
@@ -2693,6 +2693,17 @@ object Types {
}
}
+ /** A type lambda of the form `[X_0 B_0, ..., X_n B_n] => T`
+ * Variances are encoded in parameter names. A name starting with `+`
+ * designates a covariant parameter, a name starting with `-` designates
+ * a contravariant parameter, and every other name designates a non-variant parameter.
+ *
+ * @param paramNames The names `X_0`, ..., `X_n`
+ * @param paramInfosExp A function that, given the polytype itself, returns the
+ * parameter bounds `B_1`, ..., `B_n`
+ * @param resultTypeExp A function that, given the polytype itself, returns the
+ * result type `T`.
+ */
class HKTypeLambda(val paramNames: List[TypeName])(
paramInfosExp: HKTypeLambda => List[TypeBounds], resultTypeExp: HKTypeLambda => Type)
extends HKLambda with TypeLambda {
@@ -2708,18 +2719,8 @@ object Types {
protected def prefixString = "HKTypeLambda"
}
- /** A type lambda of the form `[X_0 B_0, ..., X_n B_n] => T`
- * This is used both as a type of a polymorphic method and as a type of
- * a higher-kinded type parameter. Variances are encoded in parameter
- * names. A name starting with `+` designates a covariant parameter,
- * a name starting with `-` designates a contravariant parameter,
- * and every other name designates a non-variant parameter.
- *
- * @param paramNames The names `X_0`, ..., `X_n`
- * @param paramInfosExp A function that, given the polytype itself, returns the
- * parameter bounds `B_1`, ..., `B_n`
- * @param resultTypeExp A function that, given the polytype itself, returns the
- * result type `T`.
+ /** The type of a polymorphic method. It has the same form as HKTypeLambda,
+ * except it applies to terms and parameters do not have variances.
*/
class PolyType(val paramNames: List[TypeName])(
paramInfosExp: PolyType => List[TypeBounds], resultTypeExp: PolyType => Type)