Skip to content

Commit 4a41767

Browse files
committed
[Completion] Check for callback rather than result of ResolveMacroRequest
When doing solver-based completion, the request will fail, avoid falling back to a regular call expression in that case; we only care about whether we got the callback. rdar://129024996
1 parent d9fefc8 commit 4a41767

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/IDE/CodeCompletion.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,14 +1431,14 @@ void CodeCompletionCallbacksImpl::typeCheckWithLookup(
14311431
/// decl it could be attached to. Type check it standalone.
14321432

14331433
// First try to check it as an attached macro.
1434-
auto resolvedMacro = evaluateOrDefault(
1434+
(void)evaluateOrDefault(
14351435
CurDeclContext->getASTContext().evaluator,
14361436
ResolveMacroRequest{AttrWithCompletion, CurDeclContext},
14371437
ConcreteDeclRef());
14381438

14391439
// If that fails, type check as a call to the attribute's type. This is
14401440
// how, e.g., property wrappers are modelled.
1441-
if (!resolvedMacro) {
1441+
if (!Lookup.gotCallback()) {
14421442
ASTNode Call = CallExpr::create(
14431443
CurDeclContext->getASTContext(), AttrWithCompletion->getTypeExpr(),
14441444
AttrWithCompletion->getArgs(), /*implicit=*/true);

0 commit comments

Comments
 (0)