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 {
38093809}
38103810
38113811bool MissingMemberFailure::diagnoseInLiteralCollectionContext () const {
3812- auto *expr = castToExpr (getAnchor ());
3812+ auto *expr = getAsExpr (getAnchor ());
3813+ if (!expr)
3814+ return false ;
3815+
38133816 auto *parentExpr = findParentExpr (expr);
38143817 auto &solution = getSolution ();
38153818
@@ -5918,8 +5921,11 @@ void MissingGenericArgumentsFailure::emitGenericSignatureNote(
59185921 return (type == params.end ()) ? Type () : type->second ;
59195922 };
59205923
5924+ auto baseType = anchor.dyn_cast <TypeRepr *>();
5925+ if (!baseType)
5926+ return ;
5927+
59215928 SmallString<64 > paramsAsString;
5922- auto baseType = anchor.get <TypeRepr *>();
59235929 if (TypeChecker::getDefaultGenericArgumentsString (paramsAsString, GTD,
59245930 getPreferredType)) {
59255931 auto diagnostic = emitDiagnosticAt (
You can’t perform that action at this time.
0 commit comments