diff options
author | Ondrej Lhotak <olhotak@uwaterloo.ca> | 2014-12-08 16:35:04 +0100 |
---|---|---|
committer | Ondrej Lhotak <olhotak@uwaterloo.ca> | 2014-12-13 21:52:43 +0100 |
commit | a862c6ac14d0645ee0e44ff9b447975a4d7d61ba (patch) | |
tree | 6ce22dfad7f59b097b3c0d54cc1ce11c80a37153 /src/dotty | |
parent | ed128df796ce364097865a56865b0a42fa4c1c22 (diff) | |
download | dotty-a862c6ac14d0645ee0e44ff9b447975a4d7d61ba.tar.gz dotty-a862c6ac14d0645ee0e44ff9b447975a4d7d61ba.tar.bz2 dotty-a862c6ac14d0645ee0e44ff9b447975a4d7d61ba.zip |
add stripAnnots method to Type to unwrap AnnotatedTypes
Diffstat (limited to 'src/dotty')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 5904160f5..3100be9a0 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -622,6 +622,10 @@ object Types { */ def stripTypeVar(implicit ctx: Context): Type = this + /** Remove all AnnotatedTypes wrapping this type. + */ + def stripAnnots(implicit ctx: Context): Type = this + /** Widen from singleton type to its underlying non-singleton * base type by applying one or more `underlying` dereferences, * Also go from => T to T. @@ -2506,6 +2510,7 @@ object Types { else AnnotatedType(annot, tpe) override def stripTypeVar(implicit ctx: Context): Type = tpe.stripTypeVar + override def stripAnnots(implicit ctx: Context): Type = tpe.stripAnnots } object AnnotatedType { |