File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -4640,10 +4640,12 @@ bool FailureDiagnosis::diagnoseSubscriptErrors(SubscriptExpr *SE,
4640
4640
UncurriedCandidate cand = calleeInfo.candidates [0 ];
4641
4641
auto candType = baseType->getTypeOfMember (CS.DC ->getParentModule (),
4642
4642
cand.getDecl (), nullptr );
4643
- auto paramsType = candType->getAs <FunctionType>()->getInput ();
4644
- if (!typeCheckChildIndependently (indexExpr, paramsType,
4645
- CTP_CallArgument, TCC_ForceRecheck))
4646
- return true ;
4643
+ if (auto *candFunc = candType->getAs <FunctionType>()) {
4644
+ auto paramsType = candFunc->getInput ();
4645
+ if (!typeCheckChildIndependently (
4646
+ indexExpr, paramsType, CTP_CallArgument, TCC_ForceRecheck))
4647
+ return true ;
4648
+ }
4647
4649
}
4648
4650
}
4649
4651
You can’t perform that action at this time.
0 commit comments