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 @@ -4580,7 +4580,8 @@ struct CallbackCondition {
4580
4580
// / }
4581
4581
// / ```
4582
4582
CallbackCondition (const Decl *Subject, const CaseLabelItem *CaseItem) {
4583
- if (auto *EEP = dyn_cast<EnumElementPattern>(CaseItem->getPattern ())) {
4583
+ if (auto *EEP = dyn_cast<EnumElementPattern>(
4584
+ CaseItem->getPattern ()->getSemanticsProvidingPattern ())) {
4584
4585
// `case .<func>(let <bind>)`
4585
4586
initFromEnumPattern (Subject, EEP);
4586
4587
}
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