         // MARK: - SingleValueEncodingContainer Methods
 
         func encodeNil() throws {
-            assertCanEncodeSingleValue()
+            assertCanEncodeNewValue()
             node = Node("null", Tag(.null))
         }
 

        var userInfo: [CodingUserInfoKey : Any] = [:]

        func container<Key>(keyedBy type: Key.Type) -> KeyedEncodingContainer<Key> {
            assertCanRequestNewContainer()
            node = [:]
            let wrapper = _KeyedEncodingContainer<Key>(referencing: self)
            return KeyedEncodingContainer(wrapper)
        }

        func unkeyedContainer() -> UnkeyedEncodingContainer {
            assertCanRequestNewContainer()
            node = []
            return _UnkeyedEncodingContainer(referencing: self)
        }

        func singleValueContainer() -> SingleValueEncodingContainer {
            assertCanRequestNewContainer()
            return self
        }

        // MARK: Utility

        /// Asserts that a new container can be requested at this coding path.
        /// `preconditionFailure()`s if one cannot be requested.
        func assertCanRequestNewContainer() {
            guard node == "" else {
                let previousContainerType: String
                switch node {
                case .mapping:
                    previousContainerType = "keyed"
                case .sequence:
                    previousContainerType = "unkeyed"
                case .scalar:
                    previousContainerType = "single value"
                }
                preconditionFailure(
                    "Attempt to encode with new container when already encoded with \(previousContainerType) container."
                )
            }
        }
    }


        func encode(_ value: Double) throws { try represent(value) }

        func encode(_ value: String) throws {
            assertCanEncodeNewValue()
            node = Node(value)
        }

        func encode<T>(_ value: T) throws where T : Encodable {
            assertCanEncodeNewValue()
            if let date = value as? Date {
                node = date.representedForCodable()
            } else if let representable = value as? ScalarRepresentable {
