Skip to content

Commit 030039d

Browse files
committed
[Refactoring] Add some calls to getSemanticsProvidingExpr
1 parent aa583ea commit 030039d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/IDE/Refactoring.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4466,6 +4466,7 @@ struct CallbackCondition {
44664466
CallbackCondition(const BinaryExpr *BE, const FuncDecl *Operator) {
44674467
bool FoundNil = false;
44684468
for (auto *Operand : BE->getArg()->getElements()) {
4469+
Operand = Operand->getSemanticsProvidingExpr();
44694470
if (isa<NilLiteralExpr>(Operand)) {
44704471
FoundNil = true;
44714472
} else if (auto *DRE = dyn_cast<DeclRefExpr>(Operand)) {
@@ -4912,9 +4913,9 @@ struct CallbackClassifier {
49124913
Exprs.push_back(BoolExpr);
49134914

49144915
while (!Exprs.empty()) {
4915-
auto *Next = Exprs.pop_back_val();
4916+
auto *Next = Exprs.pop_back_val()->getSemanticsProvidingExpr();
49164917
if (auto *ACE = dyn_cast<AutoClosureExpr>(Next))
4917-
Next = ACE->getSingleExpressionBody();
4918+
Next = ACE->getSingleExpressionBody()->getSemanticsProvidingExpr();
49184919

49194920
if (auto *BE = dyn_cast_or_null<BinaryExpr>(Next)) {
49204921
auto *Operator = isOperator(BE);

test/refactoring/ConvertAsync/convert_params_single.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ withError { res, err in
313313
// RUN: %refactor -convert-call-to-async-alternative -dump-text -source-filename %s -pos=%(line+1):3 | %FileCheck -check-prefix=UNBOUND %s
314314
withError { res, err in
315315
print("before")
316-
if res != nil && err == nil {
316+
if ((res != (nil)) && err == nil) {
317317
print("got result \(res!)")
318318
} else {
319319
print("got error \(err!)")

0 commit comments

Comments
 (0)