         }
     }
     public var isNull:Bool          { return type == .null }
-    public var error:ErrorType?     { switch self { case .Error(let v): return v default: return nil } }
+    public var error:JSONError?     { switch self { case .Error(let v): return v default: return nil } }
     public var bool:Bool? {
         get { switch self { case .Bool(let v):  return v default: return nil } }
         set { self = .Bool(newValue!) }

    }
}
extension JSON {
    public init?(any:Any?) {
        switch any {
        // Be careful! JSONSerialization renders bool as NSNumber use .objcType to tell the difference
        case let a as NSNumber:
            switch Swift.String(cString:a.objCType) {

extension JSON : Hashable {
    public var hashValue: Int {
        switch self {
        case .Error(let m):     fatalError("\(m)")
        case .Null:             return NSNull().hashValue
        case .Bool(let v):      return v.hashValue
        case .Number(let v):    return v.hashValue
