@@ -1261,12 +1261,11 @@ bool RValueTreatedAsLValueFailure::diagnoseAsError() {
1261
1261
ParameterTypeFlags ())});
1262
1262
1263
1263
if (auto info = getFunctionArgApplyInfo (argLoc)) {
1264
- auto &cs = getConstraintSystem ();
1265
1264
auto paramType = info->getParamType ();
1266
1265
auto argType = getType (inoutExpr)->getWithoutSpecifierType ();
1267
1266
1268
1267
PointerTypeKind ptr;
1269
- if (cs. isArrayType (argType) &&
1268
+ if (isArrayType (argType) &&
1270
1269
paramType->getAnyPointerElementType (ptr) &&
1271
1270
(ptr == PTK_UnsafePointer || ptr == PTK_UnsafeRawPointer)) {
1272
1271
emitDiagnosticAt (inoutExpr->getLoc (),
@@ -3403,27 +3402,25 @@ bool MissingMemberFailure::diagnoseForDynamicCallable() const {
3403
3402
}
3404
3403
3405
3404
bool MissingMemberFailure::diagnoseInLiteralCollectionContext () const {
3406
- auto &cs = getConstraintSystem ();
3407
3405
auto *expr = castToExpr (getAnchor ());
3408
- auto *parentExpr = cs. getParentExpr (expr);
3406
+ auto *parentExpr = findParentExpr (expr);
3409
3407
auto &solution = getSolution ();
3410
3408
3411
3409
if (!(parentExpr && isa<UnresolvedMemberExpr>(expr)))
3412
3410
return false ;
3413
3411
3414
3412
auto parentType = getType (parentExpr);
3415
3413
3416
- if (!cs. isCollectionType (parentType) && !parentType->is <TupleType>())
3414
+ if (!isCollectionType (parentType) && !parentType->is <TupleType>())
3417
3415
return false ;
3418
3416
3419
3417
if (isa<TupleExpr>(parentExpr)) {
3420
- parentExpr = cs. getParentExpr (parentExpr);
3418
+ parentExpr = findParentExpr (parentExpr);
3421
3419
if (!parentExpr)
3422
3420
return false ;
3423
3421
}
3424
3422
3425
- if (auto *defaultableVar =
3426
- cs.getType (parentExpr)->getAs <TypeVariableType>()) {
3423
+ if (auto *defaultableVar = getType (parentExpr)->getAs <TypeVariableType>()) {
3427
3424
if (solution.DefaultedConstraints .count (
3428
3425
defaultableVar->getImpl ().getLocator ()) != 0 ) {
3429
3426
emitDiagnostic (diag::unresolved_member_no_inference, getName ());
0 commit comments