diff options
Diffstat (limited to 'src/dotty')
-rw-r--r-- | src/dotty/tools/dotc/core/TypeApplications.scala | 10 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 6 | ||||
-rw-r--r-- | src/dotty/tools/dotc/typer/Namer.scala | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/dotty/tools/dotc/core/TypeApplications.scala b/src/dotty/tools/dotc/core/TypeApplications.scala index fc8876d09..c0728a8fb 100644 --- a/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/src/dotty/tools/dotc/core/TypeApplications.scala @@ -494,7 +494,9 @@ class TypeApplications(val self: Type) extends AnyVal { case self: SingletonType => -1 case self: TypeVar => self.origin.knownHK case self: WildcardType => self.optBounds.knownHK + case self: PolyParam => self.underlying.knownHK case self: TypeProxy => self.underlying.knownHK + case NoType => 0 case _ => -1 } @@ -666,13 +668,7 @@ class TypeApplications(val self: Type) extends AnyVal { instTop(tp.ref) case tp => inst.tyconIsHK = tp.isHK - val res = inst(tp) - tp match { - case tp: WildcardType => - println(s"inst $tp --> $res") - case _ => - } - res + inst(tp) } def isLazy(tp: Type): Boolean = tp.strictDealias match { diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 986a9c292..d3e97b492 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -2765,7 +2765,11 @@ object Types { def paramName = binder.paramNames(paramNum) - override def underlying(implicit ctx: Context): Type = binder.paramBounds(paramNum) + override def underlying(implicit ctx: Context): Type = { + val bounds = binder.paramBounds + if (bounds == null) NoType // this can happen if the PolyType is not initialized yet + else bounds(paramNum) + } // no customized hashCode/equals needed because cycle is broken in PolyType override def toString = s"PolyParam($paramName)" diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index 7982f288d..bc8f8e281 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -935,7 +935,7 @@ class Namer { typer: Typer => //val toParameterize = tparamSyms.nonEmpty && !isDerived //val needsLambda = sym.allOverriddenSymbols.exists(_ is HigherKinded) && !isDerived def abstracted(tp: Type): Type = - if (tparamSyms.nonEmpty && !isDerived) tp.LambdaAbstract(tparamSyms) + if (tparamSyms.nonEmpty && !tp.isHK) tp.LambdaAbstract(tparamSyms) //else if (toParameterize) tp.parameterizeWith(tparamSyms) else tp |