Fix assertion error when imported proc groups are passed as proc arguments

This commit is contained in:
Tohei Ichikawa
2026-01-10 03:02:25 -05:00
parent 24f4dda070
commit bf7c92bf09
3 changed files with 19 additions and 1 deletions

View File

@@ -1133,7 +1133,11 @@ gb_internal void check_assignment(CheckerContext *c, Operand *operand, Type *typ
x.mode = Addressing_Value;
x.type = t;
if (check_is_assignable_to(c, &x, type)) {
add_entity_use(c, operand->expr, e);
if (operand->expr->kind == Ast_SelectorExpr) {
add_entity_use(c, operand->expr->SelectorExpr.selector, e);
} else {
add_entity_use(c, operand->expr, e);
}
good = true;
break;
}

View File

@@ -0,0 +1,10 @@
package test_internal
import "core:testing"
import "test_imported_proc_groups"
@test
test_ :: proc(t: ^testing.T) {
use_proc :: proc(proc()) { }
use_proc(test_imported_proc_groups.proc_group)
}

View File

@@ -0,0 +1,4 @@
package test_imported_proc_groups
proc_group :: proc{empty_proc}
empty_proc :: proc() { }