diff options
author | liu fengyun <liufengyunchina@gmail.com> | 2016-07-21 10:41:59 +0200 |
---|---|---|
committer | liu fengyun <liufengyunchina@gmail.com> | 2016-08-24 10:26:58 +0200 |
commit | 1a7618f32c6d8060c3a87ce633645440d500aa7a (patch) | |
tree | c61d576426280d36417e64198716c71aa9e0b6ca /src/dotty/tools/dotc/core/Types.scala | |
parent | 265ade02e522c89844076b5339267eac08e44c37 (diff) | |
download | dotty-1a7618f32c6d8060c3a87ce633645440d500aa7a.tar.gz dotty-1a7618f32c6d8060c3a87ce633645440d500aa7a.tar.bz2 dotty-1a7618f32c6d8060c3a87ce633645440d500aa7a.zip |
implementation of exhaustivity and redundancy check
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 1bfd6eaee..ad27f924e 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -841,6 +841,13 @@ object Types { case _ => this } + /** Eliminate anonymous classes */ + final def deAnonymize(implicit ctx: Context): Type = this match { + case tp:TypeRef if tp.symbol.isAnonymousClass => + tp.symbol.asClass.typeRef.asSeenFrom(tp.prefix, tp.symbol.owner) + case tp => tp + } + /** Follow aliases and dereferences LazyRefs and instantiated TypeVars until type * is no longer alias type, LazyRef, or instantiated type variable. */ |