File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -3809,7 +3809,10 @@ bool MissingMemberFailure::diagnoseForDynamicCallable() const {
3809
3809
}
3810
3810
3811
3811
bool MissingMemberFailure::diagnoseInLiteralCollectionContext () const {
3812
- auto *expr = castToExpr (getAnchor ());
3812
+ auto *expr = getAsExpr (getAnchor ());
3813
+ if (!expr)
3814
+ return false ;
3815
+
3813
3816
auto *parentExpr = findParentExpr (expr);
3814
3817
auto &solution = getSolution ();
3815
3818
@@ -5918,8 +5921,11 @@ void MissingGenericArgumentsFailure::emitGenericSignatureNote(
5918
5921
return (type == params.end ()) ? Type () : type->second ;
5919
5922
};
5920
5923
5924
+ auto baseType = anchor.dyn_cast <TypeRepr *>();
5925
+ if (!baseType)
5926
+ return ;
5927
+
5921
5928
SmallString<64 > paramsAsString;
5922
- auto baseType = anchor.get <TypeRepr *>();
5923
5929
if (TypeChecker::getDefaultGenericArgumentsString (paramsAsString, GTD,
5924
5930
getPreferredType)) {
5925
5931
auto diagnostic = emitDiagnosticAt (
You can’t perform that action at this time.
0 commit comments