File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -3147,7 +3147,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
3147
3147
3148
3148
// SE-0253: Callable values of user-defined nominal types.
3149
3149
if (FD->isCallAsFunctionMethod () && !HaveDot &&
3150
- !ExprType->is <AnyMetatypeType>()) {
3150
+ ( !ExprType || !ExprType ->is <AnyMetatypeType>() )) {
3151
3151
Type funcType = getTypeOfMember (FD, dynamicLookupInfo)
3152
3152
->castTo <AnyFunctionType>()
3153
3153
->getResult ();
Original file line number Diff line number Diff line change @@ -378,3 +378,14 @@ struct test_54215016 {
378
378
// RDAR_54215016: Begin completions
379
379
}
380
380
}
381
+
382
+ // RUN: %target-swift-ide-test -code-completion -code-completion-token=CRASH_CALL_AS_FUNCTION -source-filename=%s | %FileCheck %s -check-prefix=CRASH_CALL_AS_FUNCTION
383
+ protocol HasCallAsFunctionRequirement {
384
+ func callAsFunction( )
385
+ }
386
+ struct StructWithCallAsFunction : HasCallAsFunctionRequirement {
387
+ let f = #^CRASH_CALL_AS_FUNCTION ^#
388
+ func callAsFunction( ) { }
389
+ }
390
+ // CRASH_CALL_AS_FUNCTION: Begin completion
391
+ // CRASH_CALL_AS_FUNCTION: End completions
You can’t perform that action at this time.
0 commit comments