refactor: precompute compiler enum mappings

This commit is contained in:
2026-10-30 10:10:43 +01:00
parent d7e637dc3b
commit 30a98db379
13 changed files with 452 additions and 279 deletions
+16
View File
@@ -25,6 +25,22 @@ handles_sparse_enum_get test {
try testing.expect_equal(null, eof)
}
@hide:file
sparse_optional_values :: $init_filled(TestEnum, ?i16, null, {
ident = some!(null),
int = some!(some!(i16(42))),
})
filled_comptime_storage_preserves_absence_and_nested_optional_presence test {
absent :: get(&sparse_optional_values, TestEnum.eof)
present_null :: get(&sparse_optional_values, TestEnum.ident)
present_value :: get(&sparse_optional_values, TestEnum.int)
try testing.expect(absent == null)
try testing.expect(present_null != null)
try testing.expect(present_null? == null)
try testing.expect_equal(i16(42), present_value??)
}
@hide:file
TestLeftError :: enum {
shared