Skip to content

Commit 800a9c5

Browse files
committed
Add a couple of getSemanticsProviding calls
1 parent c3e487c commit 800a9c5

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lib/IDE/Refactoring.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4534,6 +4534,9 @@ struct CallbackCondition {
45344534
/// - `case .failure(let bind) = <Subject>`
45354535
/// - `let bind = try? <Subject>.get()`
45364536
CallbackCondition(const Pattern *P, const Expr *Init) {
4537+
Init = Init->getSemanticsProvidingExpr();
4538+
P = P->getSemanticsProvidingPattern();
4539+
45374540
if (auto *DRE = dyn_cast<DeclRefExpr>(Init)) {
45384541
if (auto *OSP = dyn_cast<OptionalSomePattern>(P)) {
45394542
// `let bind = <Subject>`

test/refactoring/ConvertAsync/convert_params_single.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,12 +372,16 @@ withError { res, err in
372372
if let str2 = res {
373373
print("got result \(str2)")
374374
}
375+
if case (let str3?) = (res) {
376+
print("got result \(str3)")
377+
}
375378
print("after")
376379
}
377380
// MULTIBIND: let str = try await withError()
378381
// MULTIBIND-NEXT: print("before")
379382
// MULTIBIND-NEXT: print("got result \(str)")
380383
// MULTIBIND-NEXT: print("got result \(str)")
384+
// MULTIBIND-NEXT: print("got result \(str)")
381385
// MULTIBIND-NEXT: print("after")
382386

383387
// RUN: %refactor -convert-call-to-async-alternative -dump-text -source-filename %s -pos=%(line+1):3 | %FileCheck -check-prefix=NESTEDRET %s

0 commit comments

Comments
 (0)