From 756ba3d0dd5fe6f0f1dd0a954fb764503433da02 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 9 Apr 2017 15:09:54 +0200 Subject: Tweak logic for hk type comparisons --- compiler/src/dotty/tools/dotc/core/TypeComparer.scala | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'compiler/src/dotty/tools/dotc/core') diff --git a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala index da6d63387..54b96a253 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala @@ -726,10 +726,9 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling { tycon2 match { case param2: TypeParamRef => - isMatchingApply(tp1) || { - if (canConstrain(param2)) canInstantiate(param2) - else compareLower(bounds(param2), tyconIsTypeRef = false) - } + isMatchingApply(tp1) || + canConstrain(param2) && canInstantiate(param2) || + compareLower(bounds(param2), tyconIsTypeRef = false) case tycon2: TypeRef => isMatchingApply(tp1) || compareLower(tycon2.info.bounds, tyconIsTypeRef = true) -- cgit v1.2.3