struct field declared type inference

This commit is contained in:
2026-07-20 16:14:34 +02:00
parent ad4802a270
commit 297f2e3078
2 changed files with 14 additions and 1 deletions
+4 -1
View File
@@ -4744,12 +4744,15 @@ infer_compound_expr :: proc(
if ok && item_ok {
initialized[slot-int(item.field_start)] = true
}
if !ok || !is_inferred_record_field(checker, slot) {
if !ok {
_ = infer_nested_expr(checker, keyed_expr.left, locals, pkg, file, demanded, local_types)
continue
}
field_expected := field.type if is_runtime_type(checker, field.type) else types.INVALID
actual := infer_nested_expr(checker, keyed_expr.left, locals, pkg, file, demanded, local_types, field_expected)
if !is_inferred_record_field(checker, slot) {
continue
}
_ = record_field_expr_candidate(checker, slot, keyed_expr.left, actual, locals, pkg, file)
if is_runtime_type(checker, checker.module.types.fields[slot].type) {
_ = record_demand(