@@ -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 ) {
@@ -176,8 +175,12 @@ void ArgumentTypeCheckCompletionCallback::sawSolutionImpl(const Solution &S) {
176
175
llvm::SmallDenseMap<const VarDecl *, Type> SolutionSpecificVarTypes;
177
176
getSolutionSpecificVarTypes (S, SolutionSpecificVarTypes);
178
177
178
+ AnyFunctionType *FuncTy = nullptr ;
179
+ if (Info.ValueTy ) {
180
+ FuncTy = Info.ValueTy ->lookThroughAllOptionalTypes ()->getAs <AnyFunctionType>();
181
+ }
179
182
Results.push_back ({ExpectedTy, isa<SubscriptExpr>(ParentCall), Info.Value ,
180
- Info. ValueTy , ArgIdx, ParamIdx, std::move (ClaimedParams),
183
+ FuncTy , ArgIdx, ParamIdx, std::move (ClaimedParams),
181
184
IsNoninitialVariadic, Info.BaseTy , HasLabel, IsAsync,
182
185
SolutionSpecificVarTypes});
183
186
}
@@ -225,8 +228,7 @@ void ArgumentTypeCheckCompletionCallback::deliverResults(
225
228
}
226
229
}
227
230
if (Result.FuncTy ) {
228
- if (auto FuncTy = Result.FuncTy ->lookThroughAllOptionalTypes ()
229
- ->getAs <AnyFunctionType>()) {
231
+ if (auto FuncTy = Result.FuncTy ) {
230
232
if (Result.IsSubscript ) {
231
233
assert (SemanticContext != SemanticContextKind::None);
232
234
auto *SD = dyn_cast_or_null<SubscriptDecl>(Result.FuncD );
0 commit comments