We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c45e17f commit e1d35cbCopy full SHA for e1d35cb
Sources/CornucopiaCore/Types/AnyValue.swift
@@ -63,6 +63,9 @@ public extension Cornucopia.Core {
63
case is String.Type:
64
guard case let .string(string) = self else { throw Error.typeMismatch(info: "Expected \(T.self), got \(self) instead") }
65
return string as! T
66
+ case is Bool.Type:
67
+ guard case let .bool(bool) = self else { throw Error.typeMismatch(info: "Expected \(T.self), got \(self) instead") }
68
+ return bool as! T
69
case is Int.Type:
70
guard case let .int(int) = self else { throw Error.typeMismatch(info: "Expected \(T.self), got \(self) instead") }
71
return int as! T
0 commit comments