 
     // MARK: Native subscripting
 
-    private func descendantAtPath<Sequence: SequenceType where Sequence.Generator.Element == JSONPathType>(path: Sequence) throws -> JSON {
+    private enum SubscriptError: ErrorType {
+        case SubscriptIntoNull(type: JSONPathType.Type)
+    }
+
+    private func descendantAtPath<Path: CollectionType where Path.Generator.Element == JSONPathType>(path: Path, detectNull: Swift.Bool = false) throws -> JSON {
         return try path.reduce(self) { json, path in
             switch (json, path) {
             case let (.Dictionary(dict), key as Swift.String):


    // MARK: Simple member unpacking

    private func memberAtPath<T>(path: [JSONPathType], @noescape getter: JSON -> T?) throws -> T {
        let descendant = try descendantAtPath(path)

        guard let child = getter(descendant) else {
            throw Error.ValueNotConvertible(type: T.self)
        }

        return child
    }

    /// Retrieves a `[JSON]` from a path into the recieving structure.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - returns: An `Array` of `JSON` elements
    /// - throws:
    ///   * `JSON.Error.KeyNotFound`: A given `String` key does not exist
    ///     inside a descendant `JSON` dictionary.
    ///   * `JSON.Error.IndexOutOfBounds`: A given `Int` index is outside the
    ///     bounds of a descendant `JSON` array.
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Array`.
    public func array(path: JSONPathType...) throws -> [JSON] {
        return try memberAtPath(path) { $0.array }
    }

    /// Retrieves a `[String: JSON]` from a path into the recieving structure.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - returns: An `Dictionary` of `String` mapping to `JSON` elements
    /// - throws:
    ///   * `JSON.Error.KeyNotFound`: A given `String` key does not exist
    ///     inside a descendant `JSON` dictionary.
    ///   * `JSON.Error.IndexOutOfBounds`: A given `Int` index is outside the
    ///     bounds of a descendant `JSON` array.
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Dictionary`.
    public func dictionary(path: JSONPathType...) throws -> [Swift.String: JSON] {
        return try memberAtPath(path) { $0.dictionary }
    }

    /// Retrieves a `Double` from a path into the recieving structure.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - returns: A floating-point `Double`
    /// - throws:
    ///   * `JSON.Error.KeyNotFound`: A given `String` key does not exist
    ///     inside a descendant `JSON` dictionary.
    ///   * `JSON.Error.IndexOutOfBounds`: A given `Int` index is outside the
    ///     bounds of a descendant `JSON` array.
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Double`.
    public func double(path: JSONPathType...) throws -> Swift.Double {
        return try memberAtPath(path) { $0.double }
    }

    /// Retrieves an `Int` from a path into the recieving structure.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - returns: A numeric `Int`
    /// - throws:
    ///   * `JSON.Error.KeyNotFound`: A given `String` key does not exist
    ///     inside a descendant `JSON` dictionary.
    ///   * `JSON.Error.IndexOutOfBounds`: A given `Int` index is outside the
    ///     bounds of a descendant `JSON` array.
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Int`.
    public func int(path: JSONPathType...) throws -> Swift.Int {
        return try memberAtPath(path) { $0.int }
    }

    /// Retrieves a `String` from a path into the recieving structure.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - returns: A textual `String`
    /// - throws:
    ///   * `JSON.Error.KeyNotFound`: A given `String` key does not exist
    ///     inside a descendant `JSON` dictionary.
    ///   * `JSON.Error.IndexOutOfBounds`: A given `Int` index is outside the
    ///     bounds of a descendant `JSON` array.
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `String`.
    public func string(path: JSONPathType...) throws -> Swift.String {
        return try memberAtPath(path) { $0.string }
    }

    /// Retrieves a `Bool` from a path into the recieving structure.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - returns: A truthy `Bool`
    /// - throws:
    ///   * `JSON.Error.KeyNotFound`: A given `String` key does not exist
    ///     inside a descendant `JSON` dictionary.
    ///   * `JSON.Error.IndexOutOfBounds`: A given `Int` index is outside the
    ///     bounds of a descendant `JSON` array.
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Bool`.
    public func bool(path: JSONPathType...) throws -> Swift.Bool {
        return try memberAtPath(path) { $0.bool }
    }

    // MARK: Member unpacking with fallback

    private func memberAtPath<T>(path: [JSONPathType], @noescape or fallback: () -> T, @noescape getter: JSON -> T?) throws -> T {
        do {
            return try memberAtPath(path, getter: getter)
        } catch Error.KeyNotFound {
            return fallback()
        } catch Error.IndexOutOfBounds {
            return fallback()
        }
    }

    /// Retrieves a `[JSON]` from a path into the recieving structure or a
    /// fallback if not found.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - parameter fallback: Array to use when one is missing at the subscript.
    /// - returns: An `Array` of `JSON` elements
    /// - throws:
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Array`.
    public func array(path: JSONPathType..., @autoclosure or fallback: () -> [JSON]) throws -> [JSON] {
        return try memberAtPath(path, or: fallback) { $0.array }
    }

    /// Retrieves a `[String: JSON]` from a path into the recieving structure or
    /// a fallback if not found.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - parameter fallback: Dictionary to use when one is missing at the subscript.
    /// - returns: An `Dictionary` of `String` mapping to `JSON` elements
    /// - throws:
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Dictionary`.
    public func dictionary(path: JSONPathType..., @autoclosure or fallback: () -> [Swift.String: JSON]) throws -> [Swift.String: JSON] {
        return try memberAtPath(path, or: fallback) { $0.dictionary }
    }

    /// Retrieves a `Double` from a path into the recieving structure or a
    /// fallback if not found.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - parameter fallback: Array to use when one is missing at the subscript.
    /// - returns: A floating-point `Double`
    /// - throws:
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Double`.
    public func double(path: JSONPathType..., @autoclosure or fallback: () -> Swift.Double) throws -> Swift.Double {
        return try memberAtPath(path, or: fallback) { $0.double }
    }

    /// Retrieves an `Int` from a path into the recieving structure or a
    /// fallback if not found.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - parameter fallback: Array to use when one is missing at the subscript.
    /// - returns: A numeric `Int`
    /// - throws:
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Int`.
    public func int(path: JSONPathType..., @autoclosure or fallback: () -> Swift.Int) throws -> Swift.Int {
        return try memberAtPath(path, or: fallback) { $0.int }
    }

    /// Retrieves a `String` from a path into the recieving structure or a
    /// fallback if not found.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - parameter fallback: Array to use when one is missing at the subscript.
    /// - returns: A textual `String`
    /// - throws:
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `String`.
    public func string(path: JSONPathType..., @autoclosure or fallback: () -> Swift.String) throws -> Swift.String {
        return try memberAtPath(path, or: fallback) { $0.string }
    }

    /// Retrieves a `Bool` from a path into the recieving structure or a
    /// fallback if not found.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - parameter fallback: Array to use when one is missing at the subscript.
    /// - returns: A truthy `Bool`
    /// - throws:
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Bool`.
    public func bool(path: JSONPathType..., @autoclosure or fallback: () -> Swift.Bool) throws -> Swift.Bool {
        return try memberAtPath(path, or: fallback) { $0.bool }
    }

    // MARK: Optional member unpacking

    private func optionalAtPath<T>(path: [JSONPathType], ifNotFound: Swift.Bool, ifNull: Swift.Bool, @noescape getter: JSON -> T?) throws -> T? {
        do {
            let descendant = try descendantAtPath(path)
            switch (getter(descendant), descendant) {
            case (.Some(let child), _):
                return child
            case (.None, .Null) where ifNull:
                return nil
            case (_, _):
                throw Error.ValueNotConvertible(type: T.self)
            }
        } catch Error.KeyNotFound where ifNotFound {
            return nil
        } catch Error.IndexOutOfBounds where ifNotFound {
            return nil
        } catch Error.UnexpectedSubscript(let type) where ifNotFound && type == Swift.String.self {
            return nil
        }
    }

    /// Optionally retrieves a `[JSON]` from a path into the recieving structure.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - parameter ifNotFound: If `true`, missing key or index errors are
    ///             treated as `nil`.
    /// - returns: An `Array` of `JSON` elements if a value could be found,
    ///            otherwise `nil`.
    /// - throws:
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * If `ifNotFound` is `false`, `JSON.Error.KeyNotFound`: A given
    ///     `String` key does not exist inside a descendant `JSON` dictionary.
    ///   * If `ifNotFound` is `false`, `JSON.Error.IndexOutOfBounds`: A given
    ///     `Int` index is outside the bounds of a descendant `JSON` array.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Array`.
    public func array(path: JSONPathType..., ifNotFound: Swift.Bool) throws -> [JSON]? {
        return try optionalAtPath(path, ifNotFound: ifNotFound, ifNull: false) { $0.array }
    }

    /// Optionally retrieves a `[String: JSON]` from a path into the recieving
    /// structure.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - parameter ifNotFound: If `true`, missing key or index errors are
    ///             treated as `nil`.
    /// - returns: A `Dictionary` of `String` mapping to `JSON` elements if a
    ///            value could be found, otherwise `nil`.
    /// - throws:
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * If `ifNotFound` is `false`, `JSON.Error.KeyNotFound`: A given
    ///     `String` key does not exist inside a descendant `JSON` dictionary.
    ///   * If `ifNotFound` is `false`, `JSON.Error.IndexOutOfBounds`: A given
    ///     `Int` index is outside the bounds of a descendant `JSON` array.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Dictionary`.
    public func dictionary(path: JSONPathType..., ifNotFound: Swift.Bool) throws -> [Swift.String: JSON]? {
        return try optionalAtPath(path, ifNotFound: ifNotFound, ifNull: false) { $0.dictionary }
    }

    /// Optionally retrieves a `Double` from a path into the recieving structure.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - parameter ifNotFound: If `true`, missing key or index errors are
    ///             treated as `nil`.
    /// - returns: A `Double` if a value could be found, otherwise `nil`.
    /// - throws:
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * If `ifNotFound` is `false`, `JSON.Error.KeyNotFound`: A given
    ///     `String` key does not exist inside a descendant `JSON` dictionary.
    ///   * If `ifNotFound` is `false`, `JSON.Error.IndexOutOfBounds`: A given
    ///     `Int` index is outside the
    ///     bounds of a descendant `JSON` array.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Double`.
    public func double(path: JSONPathType..., ifNotFound: Swift.Bool) throws -> Swift.Double? {
        return try optionalAtPath(path, ifNotFound: ifNotFound, ifNull: false) { $0.double }
    }

    /// Optionally retrieves a `Int` from a path into the recieving structure.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - parameter ifNotFound: If `true`, missing key or index errors are
    ///             treated as `nil`.
    /// - returns: A numeric `Int` if a value could be found, otherwise `nil`.
    /// - throws:
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * If `ifNotFound` is `false`, `JSON.Error.KeyNotFound`: A given
    ///     `String` key does not exist inside a descendant `JSON` dictionary.
    ///   * If `ifNotFound` is `false`, `JSON.Error.IndexOutOfBounds`: A given
    ///     `Int` index is outside the bounds of a descendant `JSON` array.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Int`.
    public func int(path: JSONPathType..., ifNotFound: Swift.Bool) throws -> Swift.Int? {
        return try optionalAtPath(path, ifNotFound: ifNotFound, ifNull: false) { $0.int }
    }

    /// Optionally retrieves a `String` from a path into the recieving structure.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - parameter ifNotFound: If `true`, missing key or index errors are
    ///             treated as `nil`.
    /// - returns: A text `String` if a value could be found, otherwise `nil`.
    /// - throws:
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * If `ifNotFound` is `false`, `JSON.Error.KeyNotFound`: A given
    ///     `String` key does not exist inside a descendant `JSON` dictionary.
    ///   * If `ifNotFound` is `false`, `JSON.Error.IndexOutOfBounds`: A given
    ///     `Int` index is outside the bounds of a descendant `JSON` array.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `String`.
    public func string(path: JSONPathType..., ifNotFound: Swift.Bool) throws -> Swift.String? {
        return try optionalAtPath(path, ifNotFound: ifNotFound, ifNull: false) { $0.string }
    }

    /// Optionally retrieves a `Bool` from a path into the recieving structure.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - parameter ifNotFound: If `true`, missing key or index errors are
    ///             treated as `nil`.
    /// - returns: A truthy `Bool` if a value could be found, otherwise `nil`.
    /// - throws:
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * If `ifNotFound` is `false`, `JSON.Error.KeyNotFound`: A given
    ///     `String` key does not exist inside a descendant `JSON` dictionary.
    ///   * If `ifNotFound` is `false`, `JSON.Error.IndexOutOfBounds`: A given
    ///     `Int` index is outside the bounds of a descendant `JSON` array.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Bool`.
    public func bool(path: JSONPathType..., ifNotFound: Swift.Bool) throws -> Swift.Bool? {
        return try optionalAtPath(path, ifNotFound: ifNotFound, ifNull: false) { $0.bool }
    }

    /// Optionally retrieves a `[JSON]` from a path into the recieving structure.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - parameter ifNull: If `true`, target values matching `Null` are treated
    ///             as `nil`.
    /// - returns: An `Array` of `JSON` elements if a value could be found,
    ///            otherwise `nil`.
    /// - throws:
    ///   * `JSON.Error.KeyNotFound`: A given `String` key does not exist
    ///     inside a descendant `JSON` dictionary.
    ///   * `JSON.Error.IndexOutOfBounds`: A given `Int` index is outside the
    ///     bounds of a descendant `JSON` array.
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Array`.
    public func array(path: JSONPathType..., ifNull: Swift.Bool) throws -> [JSON]? {
        return try optionalAtPath(path, ifNotFound: false, ifNull: ifNull) { $0.array }
    }

    /// Optionally retrieves a `[String: JSON]` from a path into the recieving
    /// structure.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - parameter ifNull: If `true`, target values matching `Null` are treated
    ///             as `nil`.
    /// - returns: A `Dictionary` of `String` mapping to `JSON` elements if a
    ///            value could be found, otherwise `nil`.
    /// - throws:
    ///   * `JSON.Error.KeyNotFound`: A given `String` key does not exist
    ///     inside a descendant `JSON` dictionary.
    ///   * `JSON.Error.IndexOutOfBounds`: A given `Int` index is outside the
    ///     bounds of a descendant `JSON` array.
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Dictionary`.
    public func dictionary(path: JSONPathType..., ifNull: Swift.Bool) throws -> [Swift.String: JSON]? {
        return try optionalAtPath(path, ifNotFound: false, ifNull: ifNull) { $0.dictionary }
    }

    /// Optionally retrieves a `Double` from a path into the recieving structure.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - parameter ifNull: If `true`, target values matching `Null` are treated
    ///             as `nil`.
    /// - returns: A `Double` if a value could be found, otherwise `nil`.
    /// - throws:
    ///   * `JSON.Error.KeyNotFound`: A given `String` key does not exist
    ///     inside a descendant `JSON` dictionary.
    ///   * `JSON.Error.IndexOutOfBounds`: A given `Int` index is outside the
    ///     bounds of a descendant `JSON` array.
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Double`.
    public func double(path: JSONPathType..., ifNull: Swift.Bool) throws -> Swift.Double? {
        return try optionalAtPath(path, ifNotFound: false, ifNull: ifNull) { $0.double }
    }

    /// Optionally retrieves a `Int` from a path into the recieving structure.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - parameter ifNull: If `true`, target values matching `Null` are treated
    ///             as `nil`.
    /// - returns: A numeric `Int` if a value could be found, otherwise `nil`.
    /// - throws:
    ///   * `JSON.Error.KeyNotFound`: A given `String` key does not exist
    ///     inside a descendant `JSON` dictionary.
    ///   * `JSON.Error.IndexOutOfBounds`: A given `Int` index is outside the
    ///     bounds of a descendant `JSON` array.
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Int`.
    public func int(path: JSONPathType..., ifNull: Swift.Bool) throws -> Swift.Int? {
        return try optionalAtPath(path, ifNotFound: false, ifNull: ifNull) { $0.int }
    }

    /// Optionally retrieves a `String` from a path into the recieving structure.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - parameter ifNull: If `true`, target values matching `Null` are treated
    ///             as `nil`.
    /// - returns: A text `String` if a value could be found, otherwise `nil`.
    /// - throws:
    ///   * `JSON.Error.KeyNotFound`: A given `String` key does not exist
    ///     inside a descendant `JSON` dictionary.
    ///   * `JSON.Error.IndexOutOfBounds`: A given `Int` index is outside the
    ///     bounds of a descendant `JSON` array.
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `String`.
    public func string(path: JSONPathType..., ifNull: Swift.Bool) throws -> Swift.String? {
        return try optionalAtPath(path, ifNotFound: false, ifNull: ifNull) { $0.string }
    }

    /// Optionally retrieves a `Bool` from a path into the recieving structure.
    /// - parameter path: 0 or more `String` or `Int` that subscript the `JSON`
    /// - parameter ifNull: If `true`, target values matching `Null` are treated
    ///             as `nil`.
    /// - returns: A truthy `Bool` if a value could be found, otherwise `nil`.
    /// - throws:
    ///   * `JSON.Error.KeyNotFound`: A given `String` key does not exist
    ///     inside a descendant `JSON` dictionary.
    ///   * `JSON.Error.IndexOutOfBounds`: A given `Int` index is outside the
    ///     bounds of a descendant `JSON` array.
    ///   * `JSON.Error.UnexpectedSubscript`: A given subscript cannot be used
    ///     with the corresponding `JSON` value.
    ///   * `JSON.Error.TypeNotConvertible`: The target value's type inside of
    ///     the `JSON` instance does not match `Bool`.
    public func bool(path: JSONPathType..., ifNull: Swift.Bool) throws -> Swift.Bool? {
        return try optionalAtPath(path, ifNotFound: false, ifNull: ifNull) { $0.bool }
    }

}

                    throw Error.IndexOutOfBounds(index: index)
                }
                return array[index]
            case (.Null, let badSubscript) where detectNull:
                throw SubscriptError.SubscriptIntoNull(type: badSubscript.dynamicType)
            case (_, let badSubscript):
                throw Error.UnexpectedSubscript(type: badSubscript.dynamicType)
            }
