mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Pending further work, do not contract related parameter binding constraints that refer to the same type variable. (E.g., "$0 == $0")
This commit is contained in:
@@ -773,16 +773,23 @@ bool ConstraintGraph::contractEdges() {
|
||||
// wrapper for the argument type.
|
||||
if (kind == ConstraintKind::BindParam) {
|
||||
auto node = tyvar1->getImpl().getGraphNode();
|
||||
auto hasStrictSubtypeConstraint = false;
|
||||
auto hasDependentConstraint = false;
|
||||
|
||||
for (auto t1Constraint : node->getConstraints()) {
|
||||
if (isStrictInoutSubtypeConstraint(t1Constraint)) {
|
||||
hasStrictSubtypeConstraint = true;
|
||||
hasDependentConstraint = true;
|
||||
break;
|
||||
}
|
||||
// TODO: Temporarily inhibit contraction for chained param binding
|
||||
// constraints. (E.g., "$0 == $0")
|
||||
if (t1Constraint != constraint &&
|
||||
t1Constraint->getKind() == ConstraintKind::BindParam) {
|
||||
hasDependentConstraint = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasStrictSubtypeConstraint)
|
||||
if (hasDependentConstraint)
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user