File tree 1 file changed +8
-1
lines changed
compiler/src/dotty/tools/dotc/typer
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,14 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
217
217
// apply the result type constraint, unless method type is dependent
218
218
val resultApprox = resultTypeApprox(methType)
219
219
val savedConstraint = ctx.typerState.constraint
220
- if (! constrainResult(resultApprox, resultType))
220
+ if (! resultApprox.isInstanceOf [PolyType ] &&
221
+ // temporary fix before #2121 is in. The problem here is that errors in the code
222
+ // can lead to the result type begin higher-kinded. Then normalize gets confused
223
+ // and we end up with an assertion violation "s"inconsistent: no typevars were
224
+ // added to committable constraint". Once we distinguish between type lambdas
225
+ // and polytypes again this should hopefully become unnecessary. The error
226
+ // was triggered by neg/enums.scala.
227
+ ! constrainResult(resultApprox, resultType))
221
228
if (ctx.typerState.isCommittable)
222
229
// defer the problem until after the application;
223
230
// it might be healed by an implicit conversion
You can’t perform that action at this time.
0 commit comments