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
+13
View File
@@ -1747,6 +1747,19 @@ canonical_type :: proc(
mapping[index] = resolved
return resolved
}
if item.kind == .Sum {
left := canonical_type(module, item.child, mapping, visiting)
right := canonical_type(module, item.extra, mapping, visiting)
if resolved, compose_error := types.compose_sum(&module.type_store, left, right); compose_error == .None {
mapping[index] = resolved
return resolved
}
item.child = left
item.extra = right
resolved := types.intern(&module.type_store, item)
mapping[index] = resolved
return resolved
}
if item.kind == .Function {
params := make([]types.Type, int(item.field_count), context.temp_allocator)
for param, param_index in types.params_for(&module.type_store, value) {