@@ -36,8 +36,7 @@ bool ArgumentTypeCheckCompletionCallback::addPossibleParams(
36
36
return true ;
37
37
}
38
38
39
- ArrayRef<AnyFunctionType::Param> ParamsToPass =
40
- Res.FuncTy ->getAs <AnyFunctionType>()->getParams ();
39
+ ArrayRef<AnyFunctionType::Param> ParamsToPass = Res.FuncTy ->getParams ();
41
40
42
41
ParameterList *PL = nullptr ;
43
42
if (Res.FuncD ) {
@@ -167,8 +166,12 @@ void ArgumentTypeCheckCompletionCallback::sawSolutionImpl(const Solution &S) {
167
166
llvm::SmallDenseMap<const VarDecl *, Type> SolutionSpecificVarTypes;
168
167
getSolutionSpecificVarTypes (S, SolutionSpecificVarTypes);
169
168
169
+ AnyFunctionType *FuncTy = nullptr ;
170
+ if (Info.ValueTy ) {
171
+ FuncTy = Info.ValueTy ->lookThroughAllOptionalTypes ()->getAs <AnyFunctionType>();
172
+ }
170
173
Results.push_back ({ExpectedTy, isa<SubscriptExpr>(ParentCall), Info.Value ,
171
- Info. ValueTy , ArgIdx, ParamIdx, std::move (ClaimedParams),
174
+ FuncTy , ArgIdx, ParamIdx, std::move (ClaimedParams),
172
175
IsNoninitialVariadic, Info.BaseTy , HasLabel, IsAsync,
173
176
SolutionSpecificVarTypes});
174
177
}
@@ -216,8 +219,7 @@ void ArgumentTypeCheckCompletionCallback::deliverResults(
216
219
}
217
220
}
218
221
if (Result.FuncTy ) {
219
- if (auto FuncTy = Result.FuncTy ->lookThroughAllOptionalTypes ()
220
- ->getAs <AnyFunctionType>()) {
222
+ if (auto FuncTy = Result.FuncTy ) {
221
223
if (Result.IsSubscript ) {
222
224
assert (SemanticContext != SemanticContextKind::None);
223
225
auto *SD = dyn_cast_or_null<SubscriptDecl>(Result.FuncD );
0 commit comments