File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -250,15 +250,16 @@ void ArgumentTypeCheckCompletionCallback::deliverResults(
250250 }
251251 }
252252 if (Result.FuncTy ) {
253- if (Result.IsSubscript ) {
254- assert (SemanticContext != SemanticContextKind::None);
255- auto *SD = dyn_cast_or_null<SubscriptDecl>(Result.FuncD );
256- Lookup.addSubscriptCallPattern (
257- Result.FuncTy ->getAs <AnyFunctionType>(), SD, SemanticContext);
258- } else {
259- auto *FD = dyn_cast_or_null<AbstractFunctionDecl>(Result.FuncD );
260- Lookup.addFunctionCallPattern (Result.FuncTy ->getAs <AnyFunctionType>(),
261- FD, SemanticContext);
253+ if (auto FuncTy = Result.FuncTy ->lookThroughAllOptionalTypes ()
254+ ->getAs <AnyFunctionType>()) {
255+ if (Result.IsSubscript ) {
256+ assert (SemanticContext != SemanticContextKind::None);
257+ auto *SD = dyn_cast_or_null<SubscriptDecl>(Result.FuncD );
258+ Lookup.addSubscriptCallPattern (FuncTy, SD, SemanticContext);
259+ } else {
260+ auto *FD = dyn_cast_or_null<AbstractFunctionDecl>(Result.FuncD );
261+ Lookup.addFunctionCallPattern (FuncTy, FD, SemanticContext);
262+ }
262263 }
263264 }
264265 }
You can’t perform that action at this time.
0 commit comments