diff options
author | odersky <odersky@gmail.com> | 2017-03-09 13:18:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-09 13:18:00 +0100 |
commit | 7f6e01d0019dd9bea5535ca17c6283e64e84fecb (patch) | |
tree | f05361ede8c31236da7640358b84c11d9060692f /compiler/src/dotty/tools/dotc/core/Types.scala | |
parent | 8e5c9c4a1a4555883307b7e81fea064134f350f2 (diff) | |
parent | 57e449ed18bc4643871e5e84ddf2c9d334d12acb (diff) | |
download | dotty-7f6e01d0019dd9bea5535ca17c6283e64e84fecb.tar.gz dotty-7f6e01d0019dd9bea5535ca17c6283e64e84fecb.tar.bz2 dotty-7f6e01d0019dd9bea5535ca17c6283e64e84fecb.zip |
Merge pull request #2068 from dotty-staging/fix-#2064
Fix #2064: Avoid illegal types in OrDominator
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/Types.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/Types.scala | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index 546473b68..b8f81f1bb 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -1274,10 +1274,14 @@ object Types { def underlying(implicit ctx: Context): Type /** The closest supertype of this type. This is the same as `underlying`, - * except for TypeRefs where the upper bound is returned, and HKApplys, - * where the upper bound of the constructor is re-applied to the arguments. + * except that + * - instead of a TyperBounds type it returns its upper bound, and + * - for HKApplys it returns the upper bound of the constructor re-applied to the arguments. */ - def superType(implicit ctx: Context): Type = underlying + def superType(implicit ctx: Context): Type = underlying match { + case TypeBounds(_, hi) => hi + case st => st + } } // Every type has to inherit one of the following four abstract type classes., @@ -1766,11 +1770,6 @@ object Types { type ThisType = TypeRef override def underlying(implicit ctx: Context): Type = info - - override def superType(implicit ctx: Context): Type = info match { - case TypeBounds(_, hi) => hi - case _ => info - } } final class TermRefWithSignature(prefix: Type, name: TermName, override val sig: Signature) extends TermRef(prefix, name) { |