Skip to content

Revert: Avoid assertion failure on neg test #2891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions compiler/src/dotty/tools/dotc/typer/Applications.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down