File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
test/refactoring/ConvertAsync Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -4571,7 +4571,8 @@ struct CallbackCondition {
4571
4571
// / }
4572
4572
// / ```
4573
4573
CallbackCondition (const Decl *Subject, const CaseLabelItem *CaseItem) {
4574
- if (auto *EEP = dyn_cast<EnumElementPattern>(CaseItem->getPattern ())) {
4574
+ if (auto *EEP = dyn_cast<EnumElementPattern>(
4575
+ CaseItem->getPattern ()->getSemanticsProvidingPattern ())) {
4575
4576
// `case .<func>(let <bind>)`
4576
4577
initFromEnumPattern (Subject, EEP);
4577
4578
}
Original file line number Diff line number Diff line change @@ -265,6 +265,16 @@ func testPatterns() async throws {
265
265
// STRING-TUPLE-RESULT-NEXT: print("oh no")
266
266
// STRING-TUPLE-RESULT-NEXT: }
267
267
268
+ // RUN: %refactor-check-compiles -convert-call-to-async-alternative -dump-text -source-filename %s -pos=%(line+1):3 | %FileCheck -check-prefix=STRING-TUPLE-RESULT %s
269
+ stringTupleResult { res in
270
+ switch res {
271
+ case let . success( ( x, y) ) :
272
+ print ( x, y)
273
+ case . failure:
274
+ print ( " oh no " )
275
+ }
276
+ }
277
+
268
278
// RUN: %refactor-check-compiles -convert-call-to-async-alternative -dump-text -source-filename %s -pos=%(line+1):3 | %FileCheck -check-prefix=MIXED-TUPLE-RESULT %s
269
279
mixedTupleResult { res in
270
280
if case . failure( let err) = res {
You can’t perform that action at this time.
0 commit comments