From f9ef3bc5455450a84ebc25835f6cc61e74da30ca Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Mon, 9 Mar 2015 22:38:01 +0100 Subject: [PATCH] Fix AnnotatedType#stripTypeVar to not strip the annotation This fixes Types#hasAnnotation which calls stripTypeVar which means that it always returned false before. --- src/dotty/tools/dotc/core/Types.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 5f30f484e559..b2d53389056a 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -2602,7 +2602,8 @@ object Types { if ((annot eq this.annot) && (tpe eq this.tpe)) this else AnnotatedType(annot, tpe) - override def stripTypeVar(implicit ctx: Context): Type = tpe.stripTypeVar + override def stripTypeVar(implicit ctx: Context): Type = + derivedAnnotatedType(annot, tpe.stripTypeVar) override def stripAnnots(implicit ctx: Context): Type = tpe.stripAnnots }