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,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();
|
||||
|
||||
@@ -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