Dynamic protocols.

This commit is contained in:
Christoffer Lerno
2023-10-04 23:10:59 +02:00
committed by Christoffer Lerno
parent 4cc30c0d33
commit 49c4595457
106 changed files with 2372 additions and 2011 deletions

View File

@@ -13,7 +13,7 @@ fn void EnumMap.init(&self, ValueType init_value)
}
}
fn usz! EnumMap.to_format(&self, Formatter* formatter) @dynamic
fn usz! EnumMap.to_format(&self, Formatter* formatter) : Printable
{
usz n = formatter.print("{ ")!;
foreach (i, &value : self.values)
@@ -25,7 +25,7 @@ fn usz! EnumMap.to_format(&self, Formatter* formatter) @dynamic
return n;
}
fn String EnumMap.to_string(&self, Allocator* using = mem::heap()) @dynamic
fn String EnumMap.to_string(&self, Allocator* using = mem::heap()) : Printable
{
return string::printf("%s", *self);
}