diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2026-01-24 09:57:59 +1100 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2026-01-24 09:57:59 +1100 |
| commit | ce092169ca1d65b0c66fd2d81b0f00b828cf2e8c (patch) | |
| tree | c14dd23e0d3903de6a9d7819829308786a6c71cf /tests | |
| parent | 7a2c58610ac31f815bf058523e3d3a22dc04defe (diff) | |
Correctly resolve child parapoly structs
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/completions_test.odin | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin index 53c7fe6..19f5363 100644 --- a/tests/completions_test.odin +++ b/tests/completions_test.odin @@ -5299,3 +5299,31 @@ ast_completion_struct_using_named_vector_types :: proc(t: ^testing.T) { } test.expect_completion_docs(t, &source, "", {"Foo.bar: [3]f32", "r: f32", "x: f32"}) } + +@(test) +ast_completion_parapoly_struct_with_parapoly_child :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + SomeEnum :: enum { + enumVal1, + enumVal2 + } + + ChildStruct:: struct($enumGeneric: typeid){ + Something : string, + GenericParam: enumGeneric + } + + ParentStruct :: struct($enumGeneric: typeid){ + ParentSomething: string, + Child: ChildStruct(enumGeneric) + } + + TestGenericStructs :: proc(){ + parent : ParentStruct(SomeEnum) = {}; + parent.Child.{*} + } + `, + } + test.expect_completion_docs(t, &source, "", {"ChildStruct.GenericParam: test.SomeEnum", "ChildStruct.Something: string"}) +} |