Skip to content

Commit

Permalink
fix: change defaultcodable to anycodable to make sense
Browse files Browse the repository at this point in the history
  • Loading branch information
dscyrescotti committed Feb 13, 2021
1 parent 91b8b68 commit 83b79fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Sources/CodableX/Extensions/AnyCodable++.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ extension Dictionary: AnyCodable where Key: Codable, Value: AnyCodable { }
extension Set: AnyCodable where Element: AnyCodable { }

// MARK: - Default Collection
extension Array: DefaultCodable where Element: DefaultCodable { }
extension Dictionary: DefaultCodable where Key: Codable, Value: DefaultCodable { }
extension Set: DefaultCodable where Element: DefaultCodable { }
extension Array: DefaultCodable where Element: AnyCodable { }
extension Dictionary: DefaultCodable where Key: Codable, Value: AnyCodable { }
extension Set: DefaultCodable where Element: AnyCodable { }
3 changes: 2 additions & 1 deletion Tests/CodableXTests/DefaultableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ final class DefaultableTests: XCTestCase {
}
}

struct DefaultableTest: Codable {
struct DefaultableTest: AnyCodable {
@Defaultable var int: Int
@Defaultable var string: String
@Defaultable var double: Double
@Defaultable var bool: Bool
@Defaultable var dict: [String: DefaultableTest]
}

fileprivate let str = #"{}"#

0 comments on commit 83b79fd

Please sign in to comment.