I have a vector struct:
struct Vector(Writable):
var x: Float64
var y: Float64
#...
fn write_to(self, mut writer: Some[Writer]):
writer.write("(", self.x, ", ", self.y, ")")
Whether I include the write_to function or not a print(v) always gives the error:
/.../mojo/main.mojo:13:8: error: invalid call to 'print': failed to infer parameter 'Ts', argument type 'Vector' does not conform to trait 'Writable'
print(u)
~~~~~^~~
I’m confused by the Ts parameter reference. Have I misunderstood how Writable works?
TIA!