aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/src/dotty/tools/dotc/core/Types.scala21
1 files changed, 2 insertions, 19 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala
index cd0304140..54251cbb1 100644
--- a/compiler/src/dotty/tools/dotc/core/Types.scala
+++ b/compiler/src/dotty/tools/dotc/core/Types.scala
@@ -2588,11 +2588,6 @@ object Types {
case _ => false
}
- /** Is this polytype a higher-kinded type lambda as opposed to a polymorphic?
- * method type? Only type lambdas get created with variances, that's how we can tell.
- */
- def isTypeLambda: Boolean = variances.nonEmpty
-
/** PolyParam references to all type parameters of this type */
lazy val paramRefs: List[PolyParam] = paramNames.indices.toList.map(PolyParam(this, _))
@@ -2969,20 +2964,8 @@ object Types {
* instantiation can be a singleton type only if the upper bound
* is also a singleton type.
*/
- def instantiate(fromBelow: Boolean)(implicit ctx: Context): Type = {
- val inst = ctx.typeComparer.instanceType(origin, fromBelow)
- if (ctx.typerState.isGlobalCommittable)
- inst match {
- case inst: PolyParam =>
- assert(inst.binder.isTypeLambda, i"bad inst $this := $inst, constr = ${ctx.typerState.constraint}")
- // If this fails, you might want to turn on Config.debugCheckConstraintsClosed
- // to help find the root of the problem.
- // Note: Parameters of type lambdas are excluded from the assertion because
- // they might arise from ill-kinded code. See #1652
- case _ =>
- }
- instantiateWith(inst)
- }
+ def instantiate(fromBelow: Boolean)(implicit ctx: Context): Type =
+ instantiateWith(ctx.typeComparer.instanceType(origin, fromBelow))
/** Unwrap to instance (if instantiated) or origin (if not), until result
* is no longer a TypeVar