Skip to content

Commit 39cc1cb

Browse files
committed
[Refactoring] Add some calls to getSemanticsProvidingExpr
1 parent 5ed7cae commit 39cc1cb

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
@@ -4449,6 +4449,7 @@ struct CallbackCondition {
44494449
CallbackCondition(const BinaryExpr *BE, const FuncDecl *Operator) {
44504450
bool FoundNil = false;
44514451
for (auto *Operand : {BE->getLHS(), BE->getRHS()}) {
4452+
Operand = Operand->getSemanticsProvidingExpr();
44524453
if (isa<NilLiteralExpr>(Operand)) {
44534454
FoundNil = true;
44544455
} else if (auto *DRE = dyn_cast<DeclRefExpr>(Operand)) {
@@ -4896,9 +4897,9 @@ struct CallbackClassifier {
48964897
Exprs.push_back(BoolExpr);
48974898

48984899
while (!Exprs.empty()) {
4899-
auto *Next = Exprs.pop_back_val();
4900+
auto *Next = Exprs.pop_back_val()->getSemanticsProvidingExpr();
49004901
if (auto *ACE = dyn_cast<AutoClosureExpr>(Next))
4901-
Next = ACE->getSingleExpressionBody();
4902+
Next = ACE->getSingleExpressionBody()->getSemanticsProvidingExpr();
49024903

49034904
if (auto *BE = dyn_cast_or_null<BinaryExpr>(Next)) {
49044905
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)