
I am using Swift 5.1 and Xcode 11.2.1.
I try to debug the Yams, and it throw a error:
private func represent(_ value: Any) throws -> Node {
if let string = value as? String {
return Node(string)
} else if let representable = value as? NodeRepresentable {
return try representable.represented()
}
throw YamlError.representer(problem: "Failed to represent \(value)") // -> print "Failed to represent nil"
}
extension Optional: NodeRepresentable {
public func represented() throws -> Node {
switch self {
case let .some(wrapped):
return try represent(wrapped) // <-- The ALIAS's value hit this case, but it is nil. As it is a .some<nil>
case .none:
return Node("null", Tag(.null))
}
}
}
Is it a bug?
I am using Swift 5.1 and Xcode 11.2.1.
I try to debug the Yams, and it throw a error:
Is it a bug?