Skip to content

Commit a7b5f71

Browse files
Apply diagnostic message suggestion
1 parent df14698 commit a7b5f71

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ ERROR(could_not_find_value_member_corrected,none,
8282
"value of type %0 has no member %1; did you mean %2?",
8383
(Type, DeclName, DeclName))
8484
ERROR(could_not_find_value_dynamic_member_corrected,none,
85-
"neither the value type %0 and dynamic key path subscript of type %1 has a member %2; did you mean %3?",
85+
"value of type %0 has no dynamic member %2 using key path from root type %1; did you mean %3?",
8686
(Type, Type, DeclName, DeclName))
8787

8888
ERROR(could_not_find_type_member,none,

lib/Sema/CSDiagnostics.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2319,7 +2319,6 @@ bool MissingMemberFailure::diagnoseAsError() {
23192319
diagnostic.highlight(baseExpr->getSourceRange())
23202320
.highlight(nameLoc.getSourceRange());
23212321
correction->addFixits(diagnostic);
2322-
23232322
} else {
23242323
auto diagnostic = emitDiagnostic(
23252324
anchor->getLoc(),

test/attr/attr_dynamic_member_lookup.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ struct SR10597_W<T> {
704704
var wooo: SR10597 { SR10597() } // expected-note {{declared here}}
705705
}
706706

707-
_ = SR10597_W<SR10597>(SR10597()).wooooo // expected-error {{neither the value type 'SR10597_W<SR10597>' and dynamic key path subscript of type 'SR10597' has a member 'wooooo'; did you mean 'wooo'?}}
707+
_ = SR10597_W<SR10597>(SR10597()).wooooo // expected-error {{value of type 'SR10597_W<SR10597>' has no dynamic member 'wooooo' using key path from root type 'SR10597'; did you mean 'wooo'?}}
708708

709709
final class SR10597_1 {
710710
var woo: Int? // expected-note 2 {{'woo' declared here}}
@@ -719,4 +719,4 @@ struct SR10597_1_W<T> {
719719
}
720720
}
721721

722-
_ = SR10597_1_W<SR10597_1>(SR10597_1()).wooo // expected-error {{neither the value type 'SR10597_1_W<SR10597_1>' and dynamic key path subscript of type 'SR10597_1' has a member 'wooo'; did you mean 'woo'?}}
722+
_ = SR10597_1_W<SR10597_1>(SR10597_1()).wooo // expected-error {{value of type 'SR10597_1_W<SR10597_1>' has no dynamic member 'wooooo' using key path from root type 'SR10597_1'; did you mean 'woo'?}}

0 commit comments

Comments
 (0)