Skip to content

Commit 393626f

Browse files
authored
Merge pull request #59997 from ahoppen/pr/empty-locator-has-no-preconcurrency
[CS] Remove assertion that callee locator has an anchor
2 parents 4967854 + ae53e8a commit 393626f

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,6 @@ ConstraintLocator *ConstraintSystem::getCalleeLocator(
481481
}
482482
}
483483

484-
assert(bool(anchor) && "Expected an anchor!");
485-
486484
{
487485
// If we have a locator for a member found through key path dynamic member
488486
// lookup, then we need to chop off the elements after the
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %target-swift-ide-test --code-completion --code-completion-token COMPLETE --source-filename %s | %FileCheck %s
2+
3+
func foo(completionHandler completion: (@Sendable (Bool) -> Void)? = nil) {}
4+
5+
func test() {
6+
foo(completionHandler: #^COMPLETE^#nil)
7+
}
8+
9+
// CHECK: Begin completions
10+
// CHECK-DAG: Literal[Nil]/None/TypeRelation[Convertible]: nil[#(@Sendable (Bool) -> Void)?#];
11+
// CHECK: End completions

0 commit comments

Comments
 (0)