mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Relax enum parameter pack restriction for CodingKeys
This commit is contained in:
@@ -3226,11 +3226,13 @@ public:
|
|||||||
|
|
||||||
// Temporary restriction until we figure out pattern matching and
|
// Temporary restriction until we figure out pattern matching and
|
||||||
// enum case construction with packs.
|
// enum case construction with packs.
|
||||||
if (auto genericSig = ED->getGenericSignature()) {
|
if (!ED->isSynthesized()) {
|
||||||
for (auto paramTy : genericSig.getGenericParams()) {
|
if (auto genericSig = ED->getGenericSignature()) {
|
||||||
if (paramTy->isParameterPack()) {
|
for (auto paramTy : genericSig.getGenericParams()) {
|
||||||
ED->diagnose(diag::enum_with_pack);
|
if (paramTy->isParameterPack()) {
|
||||||
break;
|
ED->diagnose(diag::enum_with_pack);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
// RUN: %target-typecheck-verify-swift -target %target-swift-5.9-abi-triple
|
||||||
|
|
||||||
|
// We should accept this:
|
||||||
|
|
||||||
|
public struct HasPack<each T>: Codable {
|
||||||
|
var x: String?
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user