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 @@ -3153,7 +3153,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
3153
3153
3154
3154
// SE-0253: Callable values of user-defined nominal types.
3155
3155
if (FD->isCallAsFunctionMethod () && !HaveDot &&
3156
- !ExprType->is <AnyMetatypeType>()) {
3156
+ ( !ExprType || !ExprType ->is <AnyMetatypeType>() )) {
3157
3157
Type funcType = getTypeOfMember (FD, dynamicLookupInfo)
3158
3158
->castTo <AnyFunctionType>()
3159
3159
->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