Skip to content

Commit f405364

Browse files
committed
add warning/note to DiagnosticsSema for SR-4559 (unapplied reference to method named "self" can be used without qualification)
https://bugs.swift.org/browse/SR-4559
1 parent b62c1dc commit f405364

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3756,8 +3756,13 @@ NOTE(add_self_to_type,none,
37563756
WARNING(warn_unqualified_access,none,
37573757
"use of %0 treated as a reference to %1 in %2 %3",
37583758
(Identifier, DescriptiveDeclKind, DescriptiveDeclKind, DeclName))
3759+
WARNING(self_refers_to_method,none,
3760+
"'self' refers to the method '%0.self', which may be unexpected",
3761+
(StringRef))
37593762
NOTE(fix_unqualified_access_member,none,
37603763
"use 'self.' to silence this warning", ())
3764+
NOTE(fix_unqualified_access_member_named_self,none,
3765+
"use '%0.self' to silence this warning", (StringRef))
37613766
NOTE(fix_unqualified_access_top_level,none,
37623767
"use '%0' to reference the %1",
37633768
(StringRef, DescriptiveDeclKind, Identifier))

0 commit comments

Comments
 (0)