Skip to content

Commit 3c22580

Browse files
committed
Drop dead method and test
All PolyTypes get variances passed, so isTypeLambda is always true and the deleted assert is never triggered.
1 parent 9a83961 commit 3c22580

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2588,11 +2588,6 @@ object Types {
25882588
case _ => false
25892589
}
25902590

2591-
/** Is this polytype a higher-kinded type lambda as opposed to a polymorphic?
2592-
* method type? Only type lambdas get created with variances, that's how we can tell.
2593-
*/
2594-
def isTypeLambda: Boolean = variances.nonEmpty
2595-
25962591
/** PolyParam references to all type parameters of this type */
25972592
lazy val paramRefs: List[PolyParam] = paramNames.indices.toList.map(PolyParam(this, _))
25982593

@@ -2969,20 +2964,8 @@ object Types {
29692964
* instantiation can be a singleton type only if the upper bound
29702965
* is also a singleton type.
29712966
*/
2972-
def instantiate(fromBelow: Boolean)(implicit ctx: Context): Type = {
2973-
val inst = ctx.typeComparer.instanceType(origin, fromBelow)
2974-
if (ctx.typerState.isGlobalCommittable)
2975-
inst match {
2976-
case inst: PolyParam =>
2977-
assert(inst.binder.isTypeLambda, i"bad inst $this := $inst, constr = ${ctx.typerState.constraint}")
2978-
// If this fails, you might want to turn on Config.debugCheckConstraintsClosed
2979-
// to help find the root of the problem.
2980-
// Note: Parameters of type lambdas are excluded from the assertion because
2981-
// they might arise from ill-kinded code. See #1652
2982-
case _ =>
2983-
}
2984-
instantiateWith(inst)
2985-
}
2967+
def instantiate(fromBelow: Boolean)(implicit ctx: Context): Type =
2968+
instantiateWith(ctx.typeComparer.instanceType(origin, fromBelow))
29862969

29872970
/** Unwrap to instance (if instantiated) or origin (if not), until result
29882971
* is no longer a TypeVar

0 commit comments

Comments
 (0)