Skip to content

Commit 615cc42

Browse files
committed
fixup! [stdlib] Update Codable.swift
1 parent 263f5de commit 615cc42

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

stdlib/public/core/Codable.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,9 @@ public struct KeyedEncodingContainer<K: CodingKey> :
502502
/// Creates a new instance with the given container.
503503
///
504504
/// - parameter container: The container to hold.
505-
public init(_ container: some KeyedEncodingContainerProtocol<Key>) {
505+
public init<Container: KeyedEncodingContainerProtocol>(
506+
_ container: Container
507+
) where Container.Key == Key {
506508
_box = container
507509
}
508510

@@ -1465,7 +1467,9 @@ public struct KeyedDecodingContainer<K: CodingKey> :
14651467
/// Creates a new instance with the given container.
14661468
///
14671469
/// - parameter container: The container to hold.
1468-
public init(_ container: some KeyedDecodingContainerProtocol<Key>) {
1470+
public init<Container: KeyedDecodingContainerProtocol>(
1471+
_ container: Container
1472+
) where Container.Key == Key {
14691473
_box = container
14701474
}
14711475

0 commit comments

Comments
 (0)