Commit Graph

10 Commits

Author SHA1 Message Date
Anthony Latsis
2cd90bdd69 AST: Quote attributes more consistently in DiagnosticsSema.def 2025-04-22 18:23:36 +01:00
Daniel Duan
3dfc40898c [NFC] Remove Python 2 imports from __future__ (#42086)
The `__future__` we relied on is now,  where the 3 specific things are
all included [since Python 3.0](https://docs.python.org/3/library/__future__.html):

* absolute_import
* print_function
* unicode_literals
* division

These import statements are no-ops and are no longer necessary.
2022-04-13 14:01:30 -07:00
Saleem Abdulrasool
e7514e54f8 Update access-note-gen.py 2021-07-15 13:28:58 -07:00
Saleem Abdulrasool
97a44d5157 test: correct indentation for linter (NFCI)
This adjusts the style in the file to appease the linter.
2021-07-15 13:13:10 -07:00
Becca Royal-Gordon
d4cae43b46 Appease tyrannical Python linter 2021-05-22 13:01:29 -07:00
Becca Royal-Gordon
39115425b7 Rephrase all access note remarks
• There is now one access note success remark and fix-it per declaration, not per attribute/modifier.
• Failure remarks have been rephrased to better emphasize the cause of the failure.
• The wording of other access note remarks and notes have been changed to follow a similar formula.
2021-05-22 13:01:29 -07:00
Becca Royal-Gordon
a414729918 “Wrap” invalid access note diagnostics
This shows up better in Xcode, which unfortunately doesn’t really display notes very clearly.
2021-05-21 16:10:12 -07:00
Becca Royal-Gordon
e611e10b8b Mention access note when describing ObjCReason 2021-05-21 16:10:12 -07:00
Becca Royal-Gordon
801b268239 Emit access note remarks only for valid attributes
This requires deferring emission until the end of typechecking. A future change will emit access-note-related notes when an attribute is invalidated.
2021-05-21 16:10:12 -07:00
Becca Royal-Gordon
69fb104244 Diagnose access note @objc failures using remarks
This commit adds an ObjCReason::ExplicitlyObjCByAccessNote value which diagnoses invalid uses, but using remarks instead of errors so that the failures don’t block builds even with -warnings-as-errors enabled.

This commit also adds annotations to attr/attr_objc.swift to generate a ton of access note test cases from it. In this commit, many of these test cases don’t pass yet. Subsequent commits will fix these bugs.
2021-03-24 14:51:44 -07:00