Files
pplus-library/mojo/probes/struct-writable.mojo
T
alexm 568474d52f
Test (in pplus-core) / in-core (push) Failing after 28m44s
Initial commit
2026-11-12 22:23:48 -05:00

12 lines
238 B
Mojo

# probe: a struct that implements write_to prints through print()
@fieldwise_init
struct P(Writable):
var x: Int
def write_to(self, mut writer: Some[Writer]):
writer.write("P(", self.x, ")")
def main():
print(P(3))