Commit Graph

9 Commits

Author SHA1 Message Date
Doug Gregor
e3c2162be2 Cope with change to default diagnostic style 2024-02-19 02:48:36 -10:00
Apollo Zhu
9ccfb574fd Enable SE-0422 Expression macro as caller-side default argument 2024-02-14 19:22:35 -08:00
Apollo Zhu
35d5b68722 Disallow expression macro as default argument
Using as a sub expression in default argument still allowed as expression macros behave the same as built-in magic literals
2023-10-27 05:40:57 -07:00
Doug Gregor
6bb9cb8b5d [Macros] Always parse macro expansions, diagnose later
Always parse macro expansions, regardless of language mode, and
eliminate the fallback path for very, very, very old object literals
like `#Color`. Instead, check for the feature flag for macro
declaration and at macro expansion time, since this is a semantic
restriction.

While here, refactor things so the vast majority of the macro-handling
logic still applies even if the Swift Swift parser is disabled. Only
attempts to expand the macro will fail. This allows us to enable the
macro-diagnostics test everywhere.
2023-01-02 21:22:04 -08:00
Erik Eckstein
d49de1a982 ModuleInterfaceBuilder: give a more specific error message in case of a compiler mismatch 2021-04-15 14:06:17 +02:00
Alexis Laferrière
b79c7b627b [ModuleInterface] Update wording of the "failed to build module" error
The error shown when the compiler fails to build a module from its
textual interface has been creating some confusion. This is a proposal
to make it more useful to the programmer not working in the SDK, insist
on looking at the previous errors first, put less emphasis on possible
compiler bugs, and always show alternatives to the incompatible
compilers issue as this is the most common case now.
2021-01-26 15:36:46 -08:00
Brent Royal-Gordon
22e3cff700 Tweak diagnostic for failed module interface verification 2020-08-07 17:45:04 -07:00
Brent Royal-Gordon
9bc787ef5f Add a “typecheck module interface” mode 2020-08-07 16:00:15 -07:00
Brent Royal-Gordon
a7a5e340aa Improve diagnostic for broken module interfaces
Currently, when a swiftinterface file fails to load, we emit the specific diagnostics for the failures, followed by a generic “failed to load module ‘Foo’” message. This PR improves that final diagnostic, particularly when the cause may be that the interface was emitted by a newer compiler using backwards-incompatible syntax.
2020-03-13 20:31:55 -07:00