aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-02 22:05:23 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-02 22:12:52 -0400
commitc18c06ff176fb4e2188b7aeff53120dd533e7ab3 (patch)
treef4b1f09be7e8566da19bee119a1e103aadc53945 /tests
parentd86b093c6e0623ec7ced3bbd6cf5970926a8a0ab (diff)
Correctly resolve comp lit implicit values when using nested structs and not naming the fields
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index a984cb5..148252d 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -4223,3 +4223,39 @@ ast_completion_multiple_chained_call_expr :: proc(t: ^testing.T) {
}
test.expect_completion_docs( t, &source, "", {"Bazz.bazz: string"})
}
+
+@(test)
+ast_completion_nested_struct_with_enum_fields_unnamed :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Foo1 :: enum {
+ A, B,
+ }
+
+ Foo2 :: enum {
+ C, D,
+ }
+
+ Foo3 :: struct {
+ foo3: string,
+ }
+
+ Bar :: struct {
+ foo1: Foo1,
+ foo2: Foo2,
+ foo3: Foo3,
+ }
+
+ Bazz :: struct {
+ bar: Bar,
+ }
+
+ main :: proc() {
+ bazz := Bazz {
+ bar = {.A, .{*}, {}}
+ }
+ }
+ `,
+ }
+ test.expect_completion_docs( t, &source, "", {"C", "D"}, {"A", "B"})
+}