From c967c9be431cc22b60ed6a100bc3c6beeef6edd7 Mon Sep 17 00:00:00 2001 From: DanielGavin Date: Fri, 1 Sep 2023 20:17:57 +0200 Subject: Add support for generics in struct that use arrays --- tests/completions_test.odin | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'tests') 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"}) +} -- cgit v1.2.3