Skip to content

Commit 5b98f8b

Browse files
vukradoxedin
authored andcommitted
Mark the direct callee as being a callee for all ApplyExpr not just CallExpr
(cherry picked from commit 7c5b6d7)
1 parent ce17782 commit 5b98f8b

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
@@ -1161,7 +1161,7 @@ namespace {
11611161
ExprStack.pop_back();
11621162

11631163
// Mark the direct callee as being a callee.
1164-
if (auto *call = dyn_cast<CallExpr>(expr))
1164+
if (auto *call = dyn_cast<ApplyExpr>(expr))
11651165
markDirectCallee(call->getFn());
11661166

11671167
// Fold sequence expressions.

test/Constraints/operator.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,3 +290,9 @@ func rdar_62054241() {
290290
return arr.sorted(by: <) // expected-error {{no exact matches in reference to operator function '<'}}
291291
}
292292
}
293+
294+
// SR-11399 - Operator returning IUO doesn't implicitly unwrap
295+
postfix operator ^^^
296+
postfix func ^^^ (lhs: Int) -> Int! { 0 }
297+
298+
let x: Int = 1^^^

0 commit comments

Comments
 (0)