summaryrefslogtreecommitdiff
path: root/tests/hover_test.odin
diff options
context:
space:
mode:
authorBradley Lewis <22850972+BradLewis@users.noreply.github.com>2025-11-02 16:32:17 -0500
committerGitHub <noreply@github.com>2025-11-02 16:32:17 -0500
commit5163a1a307b920b5ba4bc26131536f97546c7052 (patch)
treeec6df970012a7cf601202059c54f9af9a03158a1 /tests/hover_test.odin
parent06822469106aa36774ce26c4e75d5a3ae4c21efc (diff)
parentee0663c69bedb74086662b53193fc99e23c00d42 (diff)
Merge pull request #1145 from BradLewis/fix/parapoly-typedef-returnsdev-2025-10
Add missing resolves for parapoly types
Diffstat (limited to 'tests/hover_test.odin')
-rw-r--r--tests/hover_test.odin85
1 files changed, 85 insertions, 0 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index b598c24..657bc9e 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -5408,6 +5408,91 @@ ast_hover_loop_over_enum :: proc(t: ^testing.T) {
}
test.expect_hover(t, &source, "test.foo: test.Foo")
}
+
+@(test)
+ast_hover_parapoly_return_enum :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Foo :: enum {A, B, C}
+
+ get :: proc($T: typeid) -> T {}
+
+ main :: proc() {
+ f{*}oo := get(Foo)
+ }
+
+ `,
+ }
+ test.expect_hover(t, &source, "test.foo: test.Foo")
+}
+
+@(test)
+ast_hover_parapoly_return_union :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Foo :: union {int}
+
+ get :: proc($T: typeid) -> T {}
+
+ main :: proc() {
+ f{*}oo := get(Foo)
+ }
+
+ `,
+ }
+ test.expect_hover(t, &source, "test.foo: test.Foo")
+}
+
+@(test)
+ast_hover_parapoly_return_bit_set :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Foo :: union {int}
+
+ get :: proc($T: typeid) -> T {}
+
+ main :: proc() {
+ f{*}oo := get(Foo)
+ }
+
+ `,
+ }
+ test.expect_hover(t, &source, "test.foo: test.Foo")
+}
+
+@(test)
+ast_hover_parapoly_return_slice :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Foo :: []int
+
+ get :: proc($T: typeid) -> T {}
+
+ main :: proc() {
+ f{*}oo := get(Foo)
+ }
+
+ `,
+ }
+ test.expect_hover(t, &source, "test.foo: []int")
+}
+
+@(test)
+ast_hover_parapoly_return_dynamic_array :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Foo :: [dynamic]string
+
+ get :: proc($T: typeid) -> T {}
+
+ main :: proc() {
+ f{*}oo := get(Foo)
+ }
+
+ `,
+ }
+ test.expect_hover(t, &source, "test.foo: [dynamic]string")
+}
/*
Waiting for odin fix