diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-06-13 08:50:59 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-06-13 15:23:36 -0400 |
| commit | 135e03599cc33831de46181aef69ffce24976f3d (patch) | |
| tree | 3e4c900b5f7560b6a9c7aaf709e7d3786da795e6 /tests | |
| parent | 20b4d31f49be2f74a3a34d3177f018d358ef2cf8 (diff) | |
Correctly handle array types of pointers
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/type_definition_test.odin | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/type_definition_test.odin b/tests/type_definition_test.odin index 4c0ef58..e2003df 100644 --- a/tests/type_definition_test.odin +++ b/tests/type_definition_test.odin @@ -813,3 +813,29 @@ ast_type_definition_external_package_from_external_proc :: proc(t: ^testing.T) { test.expect_type_definition_locations(t, &source, {location}) } + +@(test) +ast_type_definition_array_of_pointers :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + + Foo :: struct { + bar: int, + } + + main :: proc() { + foos := []^Foo{} + l := len(f{*}oos) + } + `, + } + + location := common.Location { + range = { + start = {line = 2, character = 2}, + end = {line = 2, character = 5}, + }, + } + + test.expect_type_definition_locations(t, &source, {location}) +} |