From 960ea75c97e69ae65e2c6df2aa8dd266b0b09e50 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 22 Jun 2016 09:41:52 +0200 Subject: Allow for HK types in widenForMatchSelector --- src/dotty/tools/dotc/typer/Inferencing.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc/typer/Inferencing.scala') diff --git a/src/dotty/tools/dotc/typer/Inferencing.scala b/src/dotty/tools/dotc/typer/Inferencing.scala index 2b37fa36c..6becd29ec 100644 --- a/src/dotty/tools/dotc/typer/Inferencing.scala +++ b/src/dotty/tools/dotc/typer/Inferencing.scala @@ -177,12 +177,14 @@ object Inferencing { def widenForMatchSelector(tp: Type)(implicit ctx: Context): Type = tp.widen match { case tp: TypeRef if !tp.symbol.isClass => widenForMatchSelector(tp.info.bounds.hi) - case tp: AnnotatedType => - tp.derivedAnnotatedType(widenForMatchSelector(tp.tpe), tp.annot) case tp @ RefinedType(parent, rname, rinfo) if !parent.typeSymbol.isClass => tp.derivedRefinedType(widenForMatchSelector(parent), rname, rinfo) case tp: RecType if !tp.parent.typeSymbol.isClass => tp.derivedRecType(widenForMatchSelector(tp.parent)) + case tp: HKApply => + widenForMatchSelector(tp.upperBound) + case tp: AnnotatedType => + tp.derivedAnnotatedType(widenForMatchSelector(tp.tpe), tp.annot) case tp => tp } -- cgit v1.2.3