summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-21 08:33:39 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-21 08:33:39 -0400
commitff9e32f263fc5aaa229ec64d28f2891b40a012f5 (patch)
tree0572371d60c97f455357fe6d9b05a4c9afd84112 /tests
parent789113379206b43f5e1988d807ae3a316174aa7e (diff)
Correctly resolve references for union field pointer types
Diffstat (limited to 'tests')
-rw-r--r--tests/references_test.odin21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/references_test.odin b/tests/references_test.odin
index 0b8b5c0..d0d99f1 100644
--- a/tests/references_test.odin
+++ b/tests/references_test.odin
@@ -1459,3 +1459,24 @@ ast_references_nested_using_bit_field_field_from_declaration :: proc(t: ^testing
test.expect_reference_locations(t, &source, locations[:])
}
+
+@(test)
+ast_references_union_member_pointer :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Foo :: struct{}
+
+ Foos :: union {
+ Foo,
+ ^F{*}oo,
+ }
+ `,
+ }
+ locations := []common.Location {
+ {range = {start = {line = 1, character = 2}, end = {line = 1, character = 5}}},
+ {range = {start = {line = 4, character = 3}, end = {line = 4, character = 6}}},
+ {range = {start = {line = 5, character = 4}, end = {line = 5, character = 7}}},
+ }
+
+ test.expect_reference_locations(t, &source, locations[:])
+}