Skip to content

Commit

Permalink
Merge pull request #81 from brentleyjones/any-array
Browse files Browse the repository at this point in the history
Fix casting for `anyArray`
  • Loading branch information
jarsen authored Nov 28, 2016
2 parents 0e81e8e + 33aa6bf commit 8715487
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/ValueType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extension Int64: ValueType {

extension Array where Element: ValueType {
public static func value(from object: Any, discardingErrors: Bool = false) throws -> [Element] {
guard let anyArray = object as? [AnyObject] else {
guard let anyArray = object as? [Any] else {
throw MarshalError.typeMismatch(expected: self, actual: type(of: object))
}

Expand All @@ -75,7 +75,7 @@ extension Array where Element: ValueType {
}

public static func value(from object: Any) throws -> [Element?] {
guard let anyArray = object as? [AnyObject] else {
guard let anyArray = object as? [Any] else {
throw MarshalError.typeMismatch(expected: self, actual: type(of: object))
}
return anyArray.map {
Expand Down

0 comments on commit 8715487

Please sign in to comment.