HashMap is now Printable. Fix access inlining for enums. #1958

This commit is contained in:
Christoffer Lerno
2025-02-12 23:11:46 +01:00
parent c9ecb09cd7
commit 1f856cacf5
6 changed files with 55 additions and 6 deletions

View File

@@ -56,6 +56,29 @@ fn void map()
}
}
def FooMap = HashMap(<char, Foobar>);
enum Foobar : inline char
{
FOO,
BAR,
BAZ
}
enum Foobar2 : int (inline char y)
{
ABC = 3,
DEF = 5,
}
fn void map_inline_enum()
{
FooMap x;
x[Foobar.BAZ] = FOO;
x[Foobar2.ABC] = BAR;
test::eq(string::tformat("%s", x), "{ 2: FOO, 3: BAR }");
x.free();
}
fn void map_remove()
{
TestHashMap m;