diff options
author | Martin Odersky <odersky@gmail.com> | 2016-07-27 22:10:15 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-27 22:10:15 +0200 |
commit | 16a688fb24b2926aad47e2977444e0b9249db50b (patch) | |
tree | e0b8a757374ec1ba168293d78b763d59e1e8ff85 /src/dotty | |
parent | 4b0cc8aabf0dbbd74979faedee7371c41177b755 (diff) | |
download | dotty-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')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 3 |
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 } |