aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-07-27 22:10:15 +0200
committerMartin Odersky <odersky@gmail.com>2016-07-27 22:10:15 +0200
commit16a688fb24b2926aad47e2977444e0b9249db50b (patch)
treee0b8a757374ec1ba168293d78b763d59e1e8ff85 /src/dotty/tools/dotc/core/Types.scala
parent4b0cc8aabf0dbbd74979faedee7371c41177b755 (diff)
downloaddotty-16a688fb24b2926aad47e2977444e0b9249db50b.tar.gz
dotty-16a688fb24b2926aad47e2977444e0b9249db50b.tar.bz2
dotty-16a688fb24b2926aad47e2977444e0b9249db50b.zip
Fix HkApply#superType if type constructor is a TypeVar
In this case, supertype is not stable and should not be cached.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala3
1 files changed, 3 insertions, 0 deletions
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
}