aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-10-30 16:34:00 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-10-30 16:34:00 -0400
commitdee527bf31a01be1effbe93377ec5018a01afa03 (patch)
tree7ff01f584744bd43bc844061eb054d178dbe8ebf /tests
parenta6357c1cd8085774765d2618e5a34aaf163d560e (diff)
Fix completions after casting a pointer to another type
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index a4e8ab0..628107a 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -4866,3 +4866,26 @@ ast_completion_proc_enum_default_value :: proc(t: ^testing.T) {
}
test.expect_completion_docs(t, &source, "", {"A", "B", "C"})
}
+
+@(test)
+ast_completion_cast_rawptr_selector :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+
+ Foo :: struct {
+ bar: bool,
+ }
+
+ Baz :: struct {
+ foo: Foo,
+ }
+
+ main :: proc() {
+ baz: Baz
+ baz_ptr := &baz
+ foo_ptr := (cast(^Foo)rawptr(baz_ptr)).{*}
+ }
+ `,
+ }
+ test.expect_completion_docs(t, &source, "", {"Foo.bar: bool"})
+}