Skip to content

Commit b642b41

Browse files
authored
Merge pull request swiftlang#32737 from vukrado/SR-11399
[Sema] Mark the direct callee as being a callee for all ApplyExprs not just CallExprs
2 parents d530e36 + 7c5b6d7 commit b642b41

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/Sema/TypeCheckConstraints.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ namespace {
11571157
ExprStack.pop_back();
11581158

11591159
// Mark the direct callee as being a callee.
1160-
if (auto *call = dyn_cast<CallExpr>(expr))
1160+
if (auto *call = dyn_cast<ApplyExpr>(expr))
11611161
markDirectCallee(call->getFn());
11621162

11631163
// Fold sequence expressions.

test/Constraints/operator.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,3 +293,9 @@ func rdar_62054241() {
293293
// expected-note@-1 {{found candidate with type '(Foo, Foo) -> Bool'}}
294294
}
295295
}
296+
297+
// SR-11399 - Operator returning IUO doesn't implicitly unwrap
298+
postfix operator ^^^
299+
postfix func ^^^ (lhs: Int) -> Int! { 0 }
300+
301+
let x: Int = 1^^^

0 commit comments

Comments
 (0)