File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 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 =>
341341 case _ => false
342342 }
343343
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+ }
356350
357351 // Avoid interpolating variables if typerstate has unreported errors.
358352 // Reason: The errors might reflect unsatisfiable constraints. In that
You can’t perform that action at this time.
0 commit comments