Commit Graph

7 Commits

Author SHA1 Message Date
Hamish Knight
e65647c559 Merge pull request #75574 from jamieQ/missing-return-diagnostics
[AST][SILOptimizer]: unify missing return diagnostics in some cases
2024-08-09 16:23:47 +01:00
Alex Hoppen
66104395d7 [Sema/SourceKit] Emit same diagnostics for missing protocol requirements on the command line and in SourceKit
Some editors use diagnostics from SourceKit to replace build issues. This causes issues if the diagnostics from SourceKit are formatted differently than the build issues. Make sure they are rendered the same way, removing most uses of `DiagnosticsEditorMode`.

To do so, always emit the `add stubs for conformance` note (which previously was only emitted in editor mode) and remove all `; add <something>` suffixes from notes that state which requirements are missing.

rdar://129283608
2024-08-07 14:01:30 -07:00
Jamie
6c676c9f22 [AST][SILOptimizer]: unify missing return diagnostics in some cases
Previously, missing return diagnostics for unreachable subscripts
differed from the treatment unreachable functions received, leading to
inconsistent diagnostic behavior. This change removes the responsibility
for handling the relevant diagnostics from the AST code, in favor of the
diagnostics implemented via the SIL optimizer. Additionally, where the
AST-generation code would previously have diagnosed a missing return for
an implicit empty getter, it will now admit as valid, deferring the
missing return diagnostics to the later SIL passes.
2024-08-07 08:14:11 -05:00
Nishith Shah
8e2e625543 [Diagnostics] Use imperative msg for protocol conformance & switch-case fixits
This commit changes fixit messages from a question/suggestion to an
imperative message for protocol conformances and switch-case. Addresses
https://github.com/apple/swift/issues/67510.
2023-08-13 22:34:26 -07:00
jreference
2cf01a18de [Sema] Fix issue 65330 Unhelpful error when missing contextually required as bridging conversion to AnyObject in structural position. Minor formatting change in previous test case 2023-05-06 10:47:15 +08:00
jreference
0c47991332 61440-fix-test-formatting 2023-04-27 08:17:54 +08:00
jreference
e18b40b743 Sema: fix for 61440 (lib/AST/GenericEnvironment) no generic environment provided for type with type parameter 2023-04-26 22:02:41 +08:00