Skip to content

Commit

Permalink
Fix HkApply#superType if type constructor is a TypeVar
Browse files Browse the repository at this point in the history
In this case, supertype is not stable and should not be cached.
  • Loading branch information
odersky committed Jul 27, 2016
1 parent 4b0cc8a commit 16a688f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 16a688f

Please sign in to comment.