diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2026-01-16 09:19:08 +0000 |
|---|---|---|
| committer | gingerBill <gingerBill@users.noreply.github.com> | 2026-01-16 09:19:08 +0000 |
| commit | a2fa32a518357aefa11edd0978f48625be7dc9e5 (patch) | |
| tree | 1d19d5510533bcfe4aaa0c2fdd9207ec8b9358fa | |
| parent | 71c4da8e344e406f02faf1bfc76148bbdfc474a8 (diff) | |
| parent | 16254ed8faa3986685ba4857c7ab51ea8fb76d16 (diff) | |
Merge branch 'master' of https://github.com/odin-lang/Odin
| -rw-r--r-- | src/check_expr.cpp | 6 | ||||
| -rw-r--r-- | tests/internal/test_imported_proc_groups.odin | 11 | ||||
| -rw-r--r-- | tests/internal/test_imported_proc_groups/proc_group.odin | 4 |
3 files changed, 20 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 74ae02f94..99f803a08 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -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; } diff --git a/tests/internal/test_imported_proc_groups.odin b/tests/internal/test_imported_proc_groups.odin new file mode 100644 index 000000000..e91af4bf5 --- /dev/null +++ b/tests/internal/test_imported_proc_groups.odin @@ -0,0 +1,11 @@ +package test_internal + +import "core:testing" +import "test_imported_proc_groups" + +// https://github.com/odin-lang/Odin/pull/6119 +@test +test_use_imported_proc_group_as_argument :: proc(t: ^testing.T) { + use_proc :: proc(proc()) { } + use_proc(test_imported_proc_groups.proc_group) +} diff --git a/tests/internal/test_imported_proc_groups/proc_group.odin b/tests/internal/test_imported_proc_groups/proc_group.odin new file mode 100644 index 000000000..59519ab9c --- /dev/null +++ b/tests/internal/test_imported_proc_groups/proc_group.odin @@ -0,0 +1,4 @@ +package test_imported_proc_groups + +proc_group :: proc{empty_proc} +empty_proc :: proc() { } |