Files
swift-mirror/userdocs/diagnostic_groups/StrictLanguageFeatures.md
Allan Shortlidge 24f5632ca1 Frontend: Implement optional parsing diagnostics for enabled language features.
Parsing for `-enable-upcoming-feature` and `-enable-experimental-feature` is
lenient by default because some projects need to be compatible with multiple
language versions and compiler toolchains simultaneously, and strict
diagnostics would be a nuisance. On the other hand, though, it would be useful
to get feedback from the compiler when you attempt to enable a feature that
doesn't exist. This change splits the difference by introducing new diagnostics
for potential feature enablement misconfigurations but leaves those diagnostics
ignored by default. Projects that wish to use them can specify `-Wwarning
StrictLanguageFeatures`.
2025-01-15 16:34:32 -08:00

444 B

Strict language feature enablement

By default, if an unrecognized feature name is specified with the -enable-upcoming-feature or -enable-experimental-feature flags, the compiler will ignore it without emitting a diagnostic since some projects must be simultaneously compatible with multiple versions of the language and toolchain. However, this warning group can be enabled to opt-in to detailed diagnostics about misspecified features.