@@ -2237,8 +2237,8 @@ bool MissingMemberFailure::diagnoseAsError() {
2237
2237
auto tryTypoCorrection = [&] {
2238
2238
TC.performTypoCorrection (getDC (), DeclRefKind::Ordinary, baseType,
2239
2239
defaultMemberLookupOptions, corrections);
2240
- // If isForKeyPathDynamicMemberLookup we are including the
2241
- // typo corrections to the wrapper type too.
2240
+ // If locator points to the member found via key path dynamic member lookup,
2241
+ // emit typo corrections for the wrapper type too.
2242
2242
if (getLocator ()->isForKeyPathDynamicMemberLookup ()) {
2243
2243
TC.performTypoCorrection (getDC (), DeclRefKind::Ordinary,
2244
2244
baseExprType, defaultMemberLookupOptions,
@@ -2312,22 +2312,22 @@ bool MissingMemberFailure::diagnoseAsError() {
2312
2312
if (auto correction = corrections.claimUniqueCorrection ()) {
2313
2313
if (getLocator ()->isForKeyPathDynamicMemberLookup ()) {
2314
2314
auto diagnostic = emitDiagnostic (
2315
- anchor->getLoc (),
2316
- diag::could_not_find_value_dynamic_member_corrected,
2317
- baseExprType, baseType, getName (),
2318
- correction->CorrectedName );
2315
+ anchor->getLoc (),
2316
+ diag::could_not_find_value_dynamic_member_corrected,
2317
+ baseExprType, baseType, getName (),
2318
+ correction->CorrectedName );
2319
2319
diagnostic.highlight (baseExpr->getSourceRange ())
2320
- .highlight (nameLoc.getSourceRange ());
2320
+ .highlight (nameLoc.getSourceRange ());
2321
2321
correction->addFixits (diagnostic);
2322
2322
2323
2323
} else {
2324
2324
auto diagnostic = emitDiagnostic (
2325
- anchor->getLoc (),
2326
- diag::could_not_find_value_member_corrected,
2327
- baseType, getName (),
2328
- correction->CorrectedName );
2325
+ anchor->getLoc (),
2326
+ diag::could_not_find_value_member_corrected,
2327
+ baseType, getName (),
2328
+ correction->CorrectedName );
2329
2329
diagnostic.highlight (baseExpr->getSourceRange ())
2330
- .highlight (nameLoc.getSourceRange ());
2330
+ .highlight (nameLoc.getSourceRange ());
2331
2331
correction->addFixits (diagnostic);
2332
2332
}
2333
2333
} else {
0 commit comments