aboutsummaryrefslogtreecommitdiff
path: root/tests/hover_test.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-13 09:26:49 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-13 09:26:49 -0400
commitf418ac1782c34ce0b30f5d3ffd444128acc10c33 (patch)
tree7e339ad7d83906d3fc27042bc46d18ece6776433 /tests/hover_test.odin
parent48529c593b435589f142e56367360bf84af3a070 (diff)
Resolve proc groups with matrix types
Diffstat (limited to 'tests/hover_test.odin')
-rw-r--r--tests/hover_test.odin32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index 72a68b5..51e53bf 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -4680,6 +4680,38 @@ ast_hover_using_bit_field_struct :: proc(t: ^testing.T) {
}
test.expect_hover(t, &source, "bit_field.c: u8 | 8")
}
+
+@(test)
+ast_hover_proc_group_parapoly_matrix :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+
+ mul :: proc {
+ matrix_mul,
+ matrix_mul_differ,
+ }
+
+ @(require_results)
+ matrix_mul :: proc "contextless" (a, b: $M/matrix[$N, N]$E) -> (c: M)
+ where !IS_ARRAY(E), IS_NUMERIC(E) #no_bounds_check {
+ return a * b
+ }
+
+ @(require_results)
+ matrix_mul_differ :: proc "contextless" (a: $A/matrix[$I, $J]$E, b: $B/matrix[J, $K]E) -> (c: matrix[I, K]E)
+ where !IS_ARRAY(E), IS_NUMERIC(E), I != K #no_bounds_check {
+ return a * b
+ }
+
+ main :: proc() {
+ a: matrix[3,3]int
+ b: matrix[3,2]int
+ c{*} := mul(a, b)
+ }
+ `,
+ }
+ test.expect_hover(t, &source, "test.c: matrix[3,2]int")
+}
/*
Waiting for odin fix