Skip to content

Commit 883a0f5

Browse files
authored
Merge pull request #66251 from slavapestov/variadic-generics-feature-5.9
Basic: Remove VariadicGenerics feature [5.9]
2 parents 0cadf31 + 9f54d51 commit 883a0f5

32 files changed

+30
-130
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5411,9 +5411,6 @@ ERROR(vararg_not_allowed,none,
54115411
"variadic parameter cannot appear outside of a function parameter list",
54125412
())
54135413

5414-
ERROR(experimental_type_with_parameter_pack,none,
5415-
"generic types with parameter packs are experimental",
5416-
())
54175414
ERROR(more_than_one_pack_in_type,none,
54185415
"generic type cannot declare more than one type pack", ())
54195416
ERROR(enum_with_pack,none,

include/swift/Basic/Features.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ UPCOMING_FEATURE(ExistentialAny, 335, 6)
115115
UPCOMING_FEATURE(ImportObjcForwardDeclarations, 384, 6)
116116

117117
EXPERIMENTAL_FEATURE(StaticAssert, false)
118-
EXPERIMENTAL_FEATURE(VariadicGenerics, false)
119118
EXPERIMENTAL_FEATURE(NamedOpaqueTypes, false)
120119
EXPERIMENTAL_FEATURE(FlowSensitiveConcurrencyCaptures, false)
121120
EXPERIMENTAL_FEATURE(CodeItemMacros, true)

lib/AST/ASTPrinter.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3204,10 +3204,6 @@ static bool usesFeatureBareSlashRegexLiterals(Decl *decl) {
32043204
return false;
32053205
}
32063206

3207-
static bool usesFeatureVariadicGenerics(Decl *decl) {
3208-
return false;
3209-
}
3210-
32113207
static bool usesFeatureTupleConformances(Decl *decl) {
32123208
return false;
32133209
}

lib/Sema/TypeCheckDeclPrimary.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -480,10 +480,6 @@ static void checkGenericParams(GenericContext *ownerCtx) {
480480
// is not enabled.
481481
auto &ctx = decl->getASTContext();
482482
if (gp->isParameterPack() && isGenericType) {
483-
if (!ctx.LangOpts.hasFeature(Feature::VariadicGenerics)) {
484-
decl->diagnose(diag::experimental_type_with_parameter_pack);
485-
}
486-
487483
TypeChecker::checkAvailability(
488484
gp->getSourceRange(),
489485
ownerCtx->getASTContext().getVariadicGenericTypeAvailability(),

test/Constraints/one_element_tuple.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -enable-experimental-feature VariadicGenerics -disable-availability-checking
2-
3-
// REQUIRES: asserts
1+
// RUN: %target-typecheck-verify-swift -disable-availability-checking
42

53
let t1: (_: Int) = (_: 3)
64

test/Constraints/pack-expansion-expressions.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -disable-availability-checking -enable-experimental-feature VariadicGenerics
2-
3-
// REQUIRES: asserts
1+
// RUN: %target-typecheck-verify-swift -disable-availability-checking
42

53
func tuplify<each T>(_ t: repeat each T) -> (repeat each T) {
64
return (repeat each t)

test/Constraints/variadic_generic_types.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -enable-experimental-feature VariadicGenerics -disable-availability-checking
2-
3-
// REQUIRES: asserts
1+
// RUN: %target-typecheck-verify-swift -disable-availability-checking
42

53
// Parsing an UnresolvedSpecializeExpr containing a PackExpansionType
64
struct G<each T> {}

test/DebugInfo/variadic-generics-count.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
// REQUIRES: asserts
21
// RUN: %target-swift-frontend -emit-ir %s -g -o - \
3-
// RUN: -parse-as-library -module-name a -enable-experimental-feature VariadicGenerics -disable-availability-checking | %FileCheck %s
2+
// RUN: -parse-as-library -module-name a -disable-availability-checking | %FileCheck %s
43

54
public func f1<each T>(ts: repeat each T) {
65
// CHECK: define {{.*}} @"$s1a2f12tsyxxQp_tRvzlF"(%swift.opaque** {{.*}}, i{{32|64}} [[COUNT1_1:.*]], %swift.type** {{.*}})

test/Frontend/experimental_feature.swift

Lines changed: 0 additions & 16 deletions
This file was deleted.

test/Generics/pack-shape-requirements.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// RUN: %target-swift-frontend -typecheck -enable-experimental-feature VariadicGenerics %s -debug-generic-signatures -disable-availability-checking 2>&1 | %FileCheck %s
2-
3-
// REQUIRES: asserts
1+
// RUN: %target-swift-frontend -typecheck %s -debug-generic-signatures -disable-availability-checking 2>&1 | %FileCheck %s
42

53
protocol P {
64
associatedtype A

0 commit comments

Comments
 (0)