mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ConstraintSystem] Don't contract edges with type holes
Holes couldn't be contracted instead solving of the constraint has to be delayed until one of the sides is bound to a type, otherwise there is a risk to loose contextual information.
This commit is contained in:
@@ -1126,6 +1126,10 @@ bool ConstraintGraph::contractEdges() {
|
||||
if (isParamBindingConstraint && tyvar1->getImpl().canBindToInOut()) {
|
||||
bool isNotContractable = true;
|
||||
if (auto bindings = CS.getPotentialBindings(tyvar1)) {
|
||||
// Holes can't be contracted.
|
||||
if (bindings.IsHole)
|
||||
continue;
|
||||
|
||||
for (auto &binding : bindings.Bindings) {
|
||||
auto type = binding.BindingType;
|
||||
isNotContractable = type.findIf([&](Type nestedType) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user