From 16a688fb24b2926aad47e2977444e0b9249db50b Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 27 Jul 2016 22:10:15 +0200 Subject: Fix HkApply#superType if type constructor is a TypeVar In this case, supertype is not stable and should not be cached. --- src/dotty/tools/dotc/core/Types.scala | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/dotty/tools/dotc/core/Types.scala') diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 373428108..3e8a8da21 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -2645,6 +2645,9 @@ object Types { if (ctx.period != validSuper) { cachedSuper = tycon match { case tp: TypeLambda => defn.AnyType + case tp: TypeVar => + // supertype not stable, since underlying might change + return tp.underlying.applyIfParameterized(args) case tp: TypeProxy => tp.superType.applyIfParameterized(args) case _ => defn.AnyType } -- cgit v1.2.3