From beff5cbba6cf80504f218391911768b134f08f0e Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 19 Jul 2017 20:16:34 +0200 Subject: [PATCH] Avoid assertion failure on neg test This commit can hopefully be reverted once #2121 is in. (reverted from commit 4c576bf840e69a227250a6c89e218a6c0f2a05d4) --- compiler/src/dotty/tools/dotc/typer/Applications.scala | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala index 38f0b7ae3865..f8189fb8f9ee 100644 --- a/compiler/src/dotty/tools/dotc/typer/Applications.scala +++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala @@ -217,14 +217,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic => // apply the result type constraint, unless method type is dependent val resultApprox = resultTypeApprox(methType) val savedConstraint = ctx.typerState.constraint - if (!resultApprox.isInstanceOf[PolyType] && - // temporary fix before #2121 is in. The problem here is that errors in the code - // can lead to the result type begin higher-kinded. Then normalize gets confused - // and we end up with an assertion violation "s"inconsistent: no typevars were - // added to committable constraint". Once we distinguish between type lambdas - // and polytypes again this should hopefully become unnecessary. The error - // was triggered by neg/enums.scala. - !constrainResult(resultApprox, resultType)) + if (!constrainResult(resultApprox, resultType)) if (ctx.typerState.isCommittable) // defer the problem until after the application; // it might be healed by an implicit conversion