close some gaps in the type system
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user