diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2023-09-01 20:17:57 +0200 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2023-09-01 20:17:57 +0200 |
| commit | c967c9be431cc22b60ed6a100bc3c6beeef6edd7 (patch) | |
| tree | 16bd0e5c1bab6a73286b8b7ef76ee5c89459c9f0 /tests | |
| parent | a72ac2941a1a54e05b4051a00ca25b0b3822b1c6 (diff) | |
Add support for generics in struct that use arrays
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/completions_test.odin | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin index eba8623..a0f198c 100644 --- a/tests/completions_test.odin +++ b/tests/completions_test.odin @@ -2362,3 +2362,30 @@ ast_local_global_function :: proc(t: ^testing.T) { {"test.my_function_two: proc(one: int)"}, ) } + +@(test) +ast_generic_struct_with_array :: proc(t: ^testing.T) { + packages := make([dynamic]test.Package) + + source := test.Source { + main = `package main + Test :: struct($T: typeid) { + values: [32]T, + } + + Test_Inner :: struct { + a, b, c: int, + } + + main :: proc() { + test := Test(Test_Inner) {} + a := test.values[0] + a.{*} + } + + `, + packages = packages[:], + } + + test.expect_completion_details(t, &source, ".", {"Test_Inner.b: int"}) +} |