mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[CSSimplify] Teach disjunction filtering that some enum cases have curried self
Cases with arguments form `(Self.Type) -> (Arg...) -> Self` function types, so `areConservativelyCompatibleArgumentLabels` should remove curried self before trying to match argument/parameter labels. Resolves: rdar://problem/49159472
This commit is contained in:
@@ -132,8 +132,11 @@ bool constraints::areConservativelyCompatibleArgumentLabels(
|
||||
hasCurriedSelf = false;
|
||||
} else if (baseType->is<AnyMetatypeType>() && decl->isInstanceMember()) {
|
||||
hasCurriedSelf = false;
|
||||
} else if (isa<EnumElementDecl>(decl)) {
|
||||
hasCurriedSelf = false;
|
||||
} else if (auto *EED = dyn_cast<EnumElementDecl>(decl)) {
|
||||
// enum elements have either `(Self.Type) -> (Arg...) -> Self`, or
|
||||
// `(Self.Type) -> Self`, in the former case self type has to be
|
||||
// stripped off.
|
||||
hasCurriedSelf = bool(EED->getParameterList());
|
||||
} else {
|
||||
hasCurriedSelf = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user