We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
func castOrFail<T>(any: Any) throws -> T
1 parent eb163af commit ec25bffCopy full SHA for ec25bff
1 file changed
Sources/Casting.swift
@@ -10,7 +10,7 @@ internal func castOrFail<T>(e: Extractor) throws -> T {
10
return try castOrFail(e.rawValue)
11
}
12
13
-public func castOrFail<T>(any: Any?) throws -> T {
+public func castOrFail<T>(any: Any) throws -> T {
14
guard let result = any as? T else {
15
throw typeMismatch("\(T.self)", actual: any, keyPath: nil)
16
0 commit comments