diff options
author | Martin Odersky <odersky@gmail.com> | 2013-03-12 10:51:20 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-03-12 10:51:20 +0100 |
commit | 54400119585ca41c28baae1cbfbeefb76b5c912a (patch) | |
tree | 85d0559c2991d5bde6732a77d068d9bd6ff67a30 /src/dotty/tools/dotc/core/TypeOps.scala | |
parent | bf8e854c9f2dc2b03be5a44c84183af21510e6ef (diff) | |
download | dotty-54400119585ca41c28baae1cbfbeefb76b5c912a.tar.gz dotty-54400119585ca41c28baae1cbfbeefb76b5c912a.tar.bz2 dotty-54400119585ca41c28baae1cbfbeefb76b5c912a.zip |
Checking abstractness of types by their flags.
Previously we looked at the info, but this forces too much. As a consequence we now systematically prefer concrete over abstract when computing & denotations. This could have the strange(?) effect that the symbol of a joint denotation is a class, yet its info is a TypeBounds value.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeOps.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/TypeOps.scala | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/dotty/tools/dotc/core/TypeOps.scala b/src/dotty/tools/dotc/core/TypeOps.scala index 7660b8f2d..48cd03f60 100644 --- a/src/dotty/tools/dotc/core/TypeOps.scala +++ b/src/dotty/tools/dotc/core/TypeOps.scala @@ -23,13 +23,8 @@ trait TypeOps { this: Context => if (sym.isStatic) tp else { val tp1 = tp.derivedNamedType(asSeenFrom(tp.prefix, pre, cls, theMap)) - if ((tp1 ne tp) && (sym is TypeParam)) - // short-circuit instantiated type parameters - // by replacing pre.tp with its alias, if it has one. - tp1.info match { - case TypeBounds(lo, hi) if lo eq hi => hi - case _ => tp1 - } + // short-circuit instantiated type parameters + if ((tp1 ne tp) && (sym is (TypeParam, butNot = Deferred))) tp1.dealias else tp1 } case ThisType(thiscls) => @@ -74,7 +69,7 @@ trait TypeOps { this: Context => } needsChecking(tp, false) && { tp.DNF forall { case (parents, refinedNames) => - val absParents = parents filter (_.info.isRealTypeBounds) + val absParents = parents filter (_.symbol is Deferred) absParents.size >= 2 || { val ap = absParents.head (parents exists (p => |