     private var currentEncoder: _IndexReferencingEncoder {
         defer { encoder.array.append("") }
         return encoder.encoder(at: count)
-    }
-
-    private func box<T: Encodable>(_ value: T) throws {
-        if let strategy = encoder.options.encodingStrategies[T.self] {
-            try strategy.closure(value, currentEncoder)
-        } else {
-            encoder.array.append(value)
-        }
     }
 }
 

        return .init(referencing: self, at: index)
    }

    private func box<T: Encodable>(_ value: T) throws {
        assertCanEncodeNewValue()
        if let strategy = options.encodingStrategies[T.self] {
            try strategy.closure(value, self)
        } else {
            object = value
        }
    }

    private var canEncodeNewValue: Bool {
        if let dictionary = object as? [String: Any], dictionary.isEmpty {
            return true


    var codingPath: [CodingKey] { return encoder.codingPath }
    var count: Int { return encoder.array.count }
    func encodeNil()             throws { try currentEncoder.encodeNil() }
    func encode(_ value: Bool)   throws { try currentEncoder.encode(value) }
    func encode(_ value: Int)    throws { try currentEncoder.encode(value) }
    func encode(_ value: Int8)   throws { try currentEncoder.encode(value) }
    func encode(_ value: Int16)  throws { try currentEncoder.encode(value) }
    func encode(_ value: Int32)  throws { try currentEncoder.encode(value) }
    func encode(_ value: Int64)  throws { try currentEncoder.encode(value) }
    func encode(_ value: UInt)   throws { try currentEncoder.encode(value) }
    func encode(_ value: UInt8)  throws { try currentEncoder.encode(value) }
    func encode(_ value: UInt16) throws { try currentEncoder.encode(value) }
    func encode(_ value: UInt32) throws { try currentEncoder.encode(value) }
    func encode(_ value: UInt64) throws { try currentEncoder.encode(value) }
    func encode(_ value: Float)  throws { try currentEncoder.encode(value) }
    func encode(_ value: Double) throws { try currentEncoder.encode(value) }
    func encode(_ value: String) throws { try currentEncoder.encode(value) }
    func encode<T>(_ value: T)   throws where T: Encodable { try currentEncoder.encode(value) }

    func nestedContainer<NestedKey>(keyedBy keyType: NestedKey.Type) -> KeyedEncodingContainer<NestedKey> {
