                     number = Int64(integer)
                 }
             }
-            return JSON.integer(JSONInteger(number))
+            return JSON.integer(Int64(number))
         }
     }
 


extension JSON: IntegerLiteralConvertible {
    public init(integerLiteral value: IntegerLiteralType) {
        let val = JSONInteger(value)
        self = .integer(val)
    }
}

        return try JSONSerializer(value: self, prettyPrint: prettyPrint, lineEndings: lineEndings).serialize()
    }
    
    /// Returns this enum's associated Array value iff `self == .array(_)`, `nil` otherwise.
    public var array: [JSON]? {
        guard case .array(let a) = self else { return nil }
        return a
    }

    /// Returns this enum's associated Dictionary value iff `self == .object(_), `nil` otherwise.
    public var object: [String: JSON]? {
        guard case .object(let o) = self else { return nil }
        return o
    }

    /// Returns this enum's associated String value iff `self == .string(_)`, `nil` otherwise.
    public var string: String? {
        guard case .string(let s) = self else { return nil }
        return s
    }

    /// Returns this enum's associated `Int64` value as an `Int` iff `self == .integer(_), `nil` otherwise.
    public var int: Int? {
        guard case .integer(let i) = self else { return nil }
        // TODO (ethan): what behaviour does this have when the native Int size is 32 bits?
        return Int(i)
    }
	
    /// Returns this enum's associated `Int64` iff `self == .integer(_)`, `nil` otherwise.
    public var int64: Int64? {
        guard case .integer(let i) = self else { return nil }
        return i
    }

    /// Returns this enum's associated Bool value iff `self == .bool(_)`, `nil` otherwise.
    public var bool: Bool? {
        guard case .bool(let b) = self else { return nil }
        return b
    }

    /// Returns this enum's associated Double value iff `self == .double(_)`, `nil` otherwise.
    public var double: Double? {
        guard case .double(let d) = self else { return nil }
        return d
