Sema: Relax enum parameter pack restriction for CodingKeys

This commit is contained in:
Slava Pestov
2025-06-13 13:23:02 -04:00
parent 84997b47ef
commit 9a101ca8f6
2 changed files with 14 additions and 5 deletions

View File

@@ -3226,6 +3226,7 @@ public:
// Temporary restriction until we figure out pattern matching and
// enum case construction with packs.
if (!ED->isSynthesized()) {
if (auto genericSig = ED->getGenericSignature()) {
for (auto paramTy : genericSig.getGenericParams()) {
if (paramTy->isParameterPack()) {
@@ -3234,6 +3235,7 @@ public:
}
}
}
}
// FIXME: Remove this once we clean up the mess involving raw values.
(void) ED->getInterfaceType();

View File

@@ -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?
}