     }
 }
 
+// MARK: - ShouldNotBeDecodedFromBool
+// https://github.com/apple/swift/pull/11885
+
+private protocol ShouldNotBeDecodedFromBool {}
+extension Int: ShouldNotBeDecodedFromBool {}
+extension Int8: ShouldNotBeDecodedFromBool {}
+extension Int16: ShouldNotBeDecodedFromBool {}
+extension Int32: ShouldNotBeDecodedFromBool {}
+extension Int64: ShouldNotBeDecodedFromBool {}
+extension UInt: ShouldNotBeDecodedFromBool {}
+extension UInt8: ShouldNotBeDecodedFromBool {}
+extension UInt16: ShouldNotBeDecodedFromBool {}
+extension UInt32: ShouldNotBeDecodedFromBool {}
+extension UInt64: ShouldNotBeDecodedFromBool {}
+extension Float: ShouldNotBeDecodedFromBool {}
+extension Double: ShouldNotBeDecodedFromBool {}
+
 // MARK: - DecodingError helpers
 
 // swiftlint:disable:next identifier_name

        return try object(for: key) is NSNull
    }

    func decode(_ type: Bool.Type, forKey key: Key)   throws -> Bool { return try unbox(for: key) }
    func decode(_ type: Int.Type, forKey key: Key)    throws -> Int { return try unbox(for: key) }
    func decode(_ type: Int8.Type, forKey key: Key)   throws -> Int8 { return try unbox(for: key) }
    func decode(_ type: Int16.Type, forKey key: Key)  throws -> Int16 { return try unbox(for: key) }
    func decode(_ type: Int32.Type, forKey key: Key)  throws -> Int32 { return try unbox(for: key) }
    func decode(_ type: Int64.Type, forKey key: Key)  throws -> Int64 { return try unbox(for: key) }
    func decode(_ type: UInt.Type, forKey key: Key)   throws -> UInt { return try unbox(for: key) }
    func decode(_ type: UInt8.Type, forKey key: Key)  throws -> UInt8 { return try unbox(for: key) }
    func decode(_ type: UInt16.Type, forKey key: Key) throws -> UInt16 { return try unbox(for: key) }
    func decode(_ type: UInt32.Type, forKey key: Key) throws -> UInt32 { return try unbox(for: key) }
    func decode(_ type: UInt64.Type, forKey key: Key) throws -> UInt64 { return try unbox(for: key) }
    func decode(_ type: Float.Type, forKey key: Key)  throws -> Float { return try unbox(for: key) }
    func decode(_ type: Double.Type, forKey key: Key) throws -> Double { return try unbox(for: key) }
    func decode(_ type: String.Type, forKey key: Key) throws -> String { return try unbox(for: key) }

    func decode<T>(_ type: T.Type, forKey key: Key) throws -> T where T: Decodable {
        return try decoder(for: key).decode(type)
    }

    func nestedContainer<NestedKey>(keyedBy type: NestedKey.Type,
                                    forKey key: Key) throws -> KeyedDecodingContainer<NestedKey> {

        return value
    }

#if _runtime(_ObjC)
    // - SeeAlso: https://github.com/apple/swift/pull/11885

    fileprivate func unbox<T: Decodable & ShouldNotBeDecodedFromBool>(_ object: Any) throws -> T {
        if let strategy = options.decodingStrategies[T.self] {
            return try strategy.closure(self)
        } else {
            return try cast(object)
        }
    }

    private func cast<T: ShouldNotBeDecodedFromBool>(_ object: Any) throws -> T {
        guard let number = object as? NSNumber, number !== kCFBooleanTrue, number !== kCFBooleanFalse else {
            throw _typeMismatch(at: codingPath, expectation: T.self, reality: object)
        }
        guard let value = object as? T else {
            throw _typeMismatch(at: codingPath, expectation: T.self, reality: object)
        }
        return value
    }

    fileprivate func unbox(_ object: Any) throws -> Bool {
        if let strategy = options.decodingStrategies[Bool.self] {
            return try strategy.closure(self)
        } else {
            return try cast(object)
        }
    }

    private func cast(_ object: Any) throws -> Bool {
        if let number = object as? NSNumber {
            if number === kCFBooleanTrue as NSNumber {
                return true
            } else if number === kCFBooleanFalse as NSNumber {
                return false
            }
        }
        throw _typeMismatch(at: codingPath, expectation: Bool.self, reality: object)
    }

#endif

    /// create a new `_Decoder` instance referencing `object` as `key` inheriting `userInfo`
    fileprivate func decoder(referencing object: Any, `as` key: CodingKey) -> _Decoder {
        return .init(object, options, userInfo, codingPath + [key])
