close some gaps in the type system

This commit is contained in:
2026-07-19 01:01:11 +02:00
parent c7e3162ecb
commit 95f90cc306
12 changed files with 367 additions and 78 deletions
+5
View File
@@ -77,6 +77,7 @@ Kind :: enum u8 {
Struct,
Union,
Fallible,
Sum,
Type_Call,
}
@@ -411,6 +412,10 @@ fallible_error :: proc(value: Type, store: ^Store) -> Type {
return item.extra if ok && item.kind == .Fallible else INVALID
}
sum_syntax :: proc(store: ^Store, left, right: Type) -> Type {
return intern(store, Node{kind=.Sum, child=left, extra=right})
}
append_sum_variants :: proc(store: ^Store, value: Type, out: ^[dynamic]Sum_Variant) -> bool {
item, ok := node(store, value)
if !ok {