mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Refactoring] Support refactoring for case let patterns
Previously we only supported `case` patterns that bound with a `let` inside the associated value like `case .success(let value)`. With this change, we also support `case let .success(value)`. Fixes rdar://79279846 [SR-14772]
This commit is contained in:
@@ -4571,7 +4571,8 @@ struct CallbackCondition {
|
||||
/// }
|
||||
/// ```
|
||||
CallbackCondition(const Decl *Subject, const CaseLabelItem *CaseItem) {
|
||||
if (auto *EEP = dyn_cast<EnumElementPattern>(CaseItem->getPattern())) {
|
||||
if (auto *EEP = dyn_cast<EnumElementPattern>(
|
||||
CaseItem->getPattern()->getSemanticsProvidingPattern())) {
|
||||
// `case .<func>(let <bind>)`
|
||||
initFromEnumPattern(Subject, EEP);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user