Skip to content

Cleanup commit #3890

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
Jan 23, 2018
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
18 changes: 6 additions & 12 deletions compiler/src/dotty/tools/dotc/typer/Inferencing.scala
Original file line number Diff line number Diff line change
Expand Up @@ -341,18 +341,12 @@ trait Inferencing { this: Typer =>
case _ => false
}

var isConstrained = false
def ensureConstrained() =
if (!isConstrained) {
isConstrained = true
tree match {
case tree: Apply => // already constrained
case _ => tree.tpe match {
case _: MethodOrPoly => // already constrained
case tp => constrainResult(tp, pt)
}
}
}
var isConstrained = tree.isInstanceOf[Apply] || tree.tpe.isInstanceOf[MethodOrPoly]

def ensureConstrained() = if (!isConstrained) {
isConstrained = true
constrainResult(tree.tpe, pt)
}

// Avoid interpolating variables if typerstate has unreported errors.
// Reason: The errors might reflect unsatisfiable constraints. In that
Expand Down