Skip to content

Commit 16a688f

Browse files
committed
Fix HkApply#superType if type constructor is a TypeVar
In this case, supertype is not stable and should not be cached.
1 parent 4b0cc8a commit 16a688f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2645,6 +2645,9 @@ object Types {
26452645
if (ctx.period != validSuper) {
26462646
cachedSuper = tycon match {
26472647
case tp: TypeLambda => defn.AnyType
2648+
case tp: TypeVar =>
2649+
// supertype not stable, since underlying might change
2650+
return tp.underlying.applyIfParameterized(args)
26482651
case tp: TypeProxy => tp.superType.applyIfParameterized(args)
26492652
case _ => defn.AnyType
26502653
}

0 commit comments

Comments
 (0)