diff options
author | Martin Odersky <odersky@gmail.com> | 2017-03-14 15:53:31 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-03-14 15:53:31 +0100 |
commit | 3c22580feccca384e83465afd38d3df689c61f88 (patch) | |
tree | 2159ec8a2f4687df15f110019e4ba4e5007e2416 /compiler | |
parent | 9a83961bdc0c1148a4045f89f419760ef0d83f63 (diff) | |
download | dotty-3c22580feccca384e83465afd38d3df689c61f88.tar.gz dotty-3c22580feccca384e83465afd38d3df689c61f88.tar.bz2 dotty-3c22580feccca384e83465afd38d3df689c61f88.zip |
Drop dead method and test
All PolyTypes get variances passed, so isTypeLambda is always true
and the deleted assert is never triggered.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/Types.scala | 21 |
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 |