mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[CSSimplify] If pack type has holes - its shape is a hole
Propagating holes to the shape helps avoid spurious diagnostics about same-shape requirement failures. Resolves: rdar://107675464
This commit is contained in:
committed by
Pavel Yaskevich
parent
3006f55327
commit
0db67464da
@@ -13269,6 +13269,14 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyShapeOfConstraint(
|
||||
return formUnsolved();
|
||||
}
|
||||
|
||||
if (type1->hasPlaceholder()) {
|
||||
if (!shouldAttemptFixes())
|
||||
return SolutionKind::Error;
|
||||
|
||||
recordTypeVariablesAsHoles(type2);
|
||||
return SolutionKind::Solved;
|
||||
}
|
||||
|
||||
auto shape = type1->getReducedShape();
|
||||
addConstraint(ConstraintKind::Bind, shape, type2, locator);
|
||||
return SolutionKind::Solved;
|
||||
|
||||
Reference in New Issue
Block a user