Skip to content

Commit 01d4634

Browse files
committed
[SE-0361] Remove the feature flag for bound generic extensions.
1 parent 04bbde1 commit 01d4634

File tree

6 files changed

+0
-32
lines changed

6 files changed

+0
-32
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,9 +1907,6 @@ ERROR(extension_access_with_conformances,none,
19071907
"protocol conformances", (DeclAttribute))
19081908
ERROR(extension_metatype,none,
19091909
"cannot extend a metatype %0", (Type))
1910-
ERROR(extension_specialization,none,
1911-
"constrained extension must be declared on the unspecialized generic "
1912-
"type %0 with constraints specified by a 'where' clause", (Identifier))
19131910
ERROR(extension_placeholder,none,
19141911
"cannot extend a type that contains placeholders", ())
19151912
ERROR(extension_stored_property,none,

include/swift/Basic/Features.def

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,6 @@ EXPERIMENTAL_FEATURE(MoveOnly)
101101
EXPERIMENTAL_FEATURE(OneWayClosureParameters)
102102
EXPERIMENTAL_FEATURE(TypeWitnessSystemInference)
103103

104-
/// Enable extensions of (sugared) bound generic types
105-
///
106-
/// \code
107-
/// extension [Int] { /**/ }
108-
/// \endcode
109-
EXPERIMENTAL_FEATURE(BoundGenericExtensions)
110-
111104
/// Whether to enable experimental differentiable programming features:
112105
/// `@differentiable` declaration attribute, etc.
113106
EXPERIMENTAL_FEATURE(DifferentiableProgramming)

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,6 @@ def enable_resilience : Flag<["-"], "enable-resilience">,
317317
def enable_experimental_async_top_level :
318318
Flag<["-"], "enable-experimental-async-top-level">,
319319
HelpText<"Enable experimental concurrency in top-level code">;
320-
321-
def enable_experimental_bound_generic_extensions :
322-
Flag<["-"], "enable-experimental-bound-generic-extensions">,
323-
HelpText<"Enable experimental support for extensions of bound generic types">;
324320
}
325321

326322
// HIDDEN FLAGS

lib/AST/ASTPrinter.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3035,10 +3035,6 @@ static bool usesFeatureTypeWitnessSystemInference(Decl *decl) {
30353035
return false;
30363036
}
30373037

3038-
static bool usesFeatureBoundGenericExtensions(Decl *decl) {
3039-
return false;
3040-
}
3041-
30423038
static bool usesFeatureDifferentiableProgramming(Decl *decl) {
30433039
return false;
30443040
}

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,8 +656,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
656656
Opts.Features.insert(Feature::OneWayClosureParameters);
657657
if (Args.hasArg(OPT_enable_experimental_associated_type_inference))
658658
Opts.Features.insert(Feature::TypeWitnessSystemInference);
659-
if (Args.hasArg(OPT_enable_experimental_bound_generic_extensions))
660-
Opts.Features.insert(Feature::BoundGenericExtensions);
661659
if (Args.hasArg(OPT_enable_experimental_forward_mode_differentiation))
662660
Opts.Features.insert(Feature::ForwardModeDifferentiation);
663661
if (Args.hasArg(OPT_enable_experimental_additive_arithmetic_derivation))

lib/Sema/TypeCheckDecl.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2846,17 +2846,5 @@ ExtendedTypeRequest::evaluate(Evaluator &eval, ExtensionDecl *ext) const {
28462846
return error();
28472847
}
28482848

2849-
// By default, the user cannot extend a bound generic type, unless it's
2850-
// referenced via a non-generic typealias type.
2851-
if (!ext->getASTContext().LangOpts.hasFeature(
2852-
Feature::BoundGenericExtensions) &&
2853-
extendedType->isSpecialized() &&
2854-
!isNonGenericTypeAliasType(extendedType)) {
2855-
diags.diagnose(ext->getLoc(), diag::extension_specialization,
2856-
extendedType->getAnyNominal()->getName())
2857-
.highlight(extendedRepr->getSourceRange());
2858-
return error();
2859-
}
2860-
28612849
return extendedType;
28622850
}

0 commit comments

Comments
 (0)