From a862c6ac14d0645ee0e44ff9b447975a4d7d61ba Mon Sep 17 00:00:00 2001 From: Ondrej Lhotak Date: Mon, 8 Dec 2014 16:35:04 +0100 Subject: add stripAnnots method to Type to unwrap AnnotatedTypes --- src/dotty/tools/dotc/core/Types.scala | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/dotty/tools/dotc/core/Types.scala') 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 { -- cgit v1.2.3