File tree 1 file changed +6
-12
lines changed
compiler/src/dotty/tools/dotc/typer
1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -341,18 +341,12 @@ trait Inferencing { this: Typer =>
341
341
case _ => false
342
342
}
343
343
344
- var isConstrained = false
345
- def ensureConstrained () =
346
- if (! isConstrained) {
347
- isConstrained = true
348
- tree match {
349
- case tree : Apply => // already constrained
350
- case _ => tree.tpe match {
351
- case _ : MethodOrPoly => // already constrained
352
- case tp => constrainResult(tp, pt)
353
- }
354
- }
355
- }
344
+ var isConstrained = tree.isInstanceOf [Apply ] || tree.tpe.isInstanceOf [MethodOrPoly ]
345
+
346
+ def ensureConstrained () = if (! isConstrained) {
347
+ isConstrained = true
348
+ constrainResult(tree.tpe, pt)
349
+ }
356
350
357
351
// Avoid interpolating variables if typerstate has unreported errors.
358
352
// Reason: The errors might reflect unsatisfiable constraints. In that
You can’t perform that action at this time.
0 commit comments