let val: JSONEncodable = SomeTypeThatImplementsJSONEncodable()
public func toJSON() throws -> AnyObject {
return try JSONEncoder.create { encoder in
try encoder.encode(val, key: "SomeKey")
}
}
The error given is "Cannot invoke 'encode' with an argument list of type '(JSONEncodable, key: String)'." This seems to be because the following method on JSONEncoder is marked private:
This fails to compile:
The error given is "Cannot invoke 'encode' with an argument list of type '(JSONEncodable, key: String)'." This seems to be because the following method on JSONEncoder is marked private:
private func encode(value: JSONEncodable, key: String) throws
Is there some reason this shouldn't be marked public?