[AST/Sema] SE-0487: Rename @extensible into @nonexhaustive

This is an accepted spelling for the attribute. This commit
also renames the feature flag from `ExtensibleAttribute` to
`NonexhaustiveAttribute` to match the spelling of the attribute.

(cherry picked from commit fe1ae75711)
This commit is contained in:
Pavel Yaskevich
2025-07-01 14:21:49 -07:00
parent cefa0b2fbf
commit c9722333b9
16 changed files with 101 additions and 101 deletions

View File

@@ -876,11 +876,11 @@ SIMPLE_DECL_ATTR(constInitialized, ConstInitialized,
168)
DECL_ATTR_FEATURE_REQUIREMENT(ConstInitialized, CompileTimeValues)
SIMPLE_DECL_ATTR(extensible, Extensible,
SIMPLE_DECL_ATTR(nonexhaustive, Nonexhaustive,
OnEnum,
ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove | ForbiddenInABIAttr,
169)
DECL_ATTR_FEATURE_REQUIREMENT(Extensible, ExtensibleAttribute)
DECL_ATTR_FEATURE_REQUIREMENT(Nonexhaustive, NonexhaustiveAttribute)
SIMPLE_DECL_ATTR(concurrent, Concurrent,
OnFunc | OnConstructor | OnSubscript | OnVar,
@@ -891,8 +891,8 @@ SIMPLE_DECL_ATTR(preEnumExtensibility, PreEnumExtensibility,
OnEnum,
ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIBreakingToRemove | UnconstrainedInABIAttr,
171)
DECL_ATTR_FEATURE_REQUIREMENT(PreEnumExtensibility, ExtensibleAttribute)
DECL_ATTR_FEATURE_REQUIREMENT(PreEnumExtensibility, NonexhaustiveAttribute)
LAST_DECL_ATTR(PreEnumExtensibility)
#undef DECL_ATTR_ALIAS

View File

@@ -8712,20 +8712,20 @@ GROUPED_WARNING(
(StringRef))
//===----------------------------------------------------------------------===//
// MARK: @extensible and @preEnumExtensibility Attributes
// MARK: @nonexhaustive and @preEnumExtensibility Attributes
//===----------------------------------------------------------------------===//
ERROR(extensible_attr_on_frozen_type,none,
"cannot use '@extensible' together with '@frozen'", ())
ERROR(nonexhaustive_attr_on_frozen_type,none,
"cannot use '@nonexhaustive' together with '@frozen'", ())
ERROR(extensible_attr_on_internal_type,none,
"'@extensible' attribute can only be applied to public or package "
ERROR(nonexhaustive_attr_on_internal_type,none,
"'@nonexhaustive' attribute can only be applied to public or package "
"declarations, but %0 is "
"%select{private|fileprivate|internal|%error|%error|%error}1",
(DeclName, AccessLevel))
ERROR(pre_enum_extensibility_without_extensible,none,
"%0 can only be used together with '@extensible' attribute", (DeclAttribute))
ERROR(pre_enum_extensibility_without_nonexhaustive,none,
"%0 can only be used together with '@nonexhaustive' attribute", (DeclAttribute))
//===----------------------------------------------------------------------===//
// MARK: `using` declaration

View File

@@ -520,6 +520,9 @@ EXPERIMENTAL_FEATURE(AllowRuntimeSymbolDeclarations, true)
/// Optimize copies of ObjectiveC blocks.
EXPERIMENTAL_FEATURE(CopyBlockOptimization, true)
/// Allow use of `@nonexhaustive` on public enums
SUPPRESSIBLE_EXPERIMENTAL_FEATURE(NonexhaustiveAttribute, false)
/// Allow use of `using` declaration that control default isolation
/// in a file scope.
EXPERIMENTAL_FEATURE(DefaultIsolationPerFile, false)
@@ -527,9 +530,6 @@ EXPERIMENTAL_FEATURE(DefaultIsolationPerFile, false)
/// Enable @_lifetime attribute
SUPPRESSIBLE_EXPERIMENTAL_FEATURE(Lifetimes, true)
/// Allow use of `@extensible` on public enums
SUPPRESSIBLE_EXPERIMENTAL_FEATURE(ExtensibleAttribute, false)
#undef EXPERIMENTAL_FEATURE_EXCLUDED_FROM_MODULE_INTERFACE
#undef EXPERIMENTAL_FEATURE
#undef UPCOMING_FEATURE