Commit Graph

11 Commits

Author SHA1 Message Date
Artem Chikin
281f84da0f [Compile Time Values] Rewrite the 'Diagnose Unknown Compile Time Values' diagnostic pass in Swift 2025-03-28 10:30:07 -07:00
Artem Chikin
114af54875 [Compile Time Values] Rebase on top of newly-added experimental feature for the '@const' attribute 2025-03-27 14:33:38 -07:00
Artem Chikin
d484ec7c1f [Compile Time Values] Implement a mandatory SIL pass to verify '@const' values 2025-03-27 14:33:35 -07:00
Kuba Mracek
8a9d7e632b [Compile Time Values] Adjust error text in test/Sema/const_pass_as_arguments.swift 2025-03-24 15:00:13 -07: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
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
Xi Ge
48ac9e0683 sema: only require static keyword when _const is used in a type context 2022-02-05 21:23:36 -08:00
Xi Ge
337b93f797 sema: properly handle Array/Dictionary literals as compile-time literals 2021-11-23 19:23:15 -08:00
Xi Ge
d45a0ce45f sema: diagnose compile-time const variables are properly initialized 2021-11-23 13:56:10 -08:00
Xi Ge
7856bbae53 sema: require witness for _const decls to be also _const 2021-11-22 15:18:29 -08:00
Xi Ge
03c76bd32d sema: diagnose passing a non-constant value into a constant parameter 2021-11-22 11:52:57 -08:00