From 187e8033a37207cb38db9453d8e17299227716e7 Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Sun, 8 Feb 2026 12:31:44 +1100 Subject: Fix parapoly union types being overridden incorrectly --- src/server/generics.odin | 2 +- tests/hover_test.odin | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/server/generics.odin b/src/server/generics.odin index 8aa111f..82f71c1 100644 --- a/src/server/generics.odin +++ b/src/server/generics.odin @@ -894,7 +894,7 @@ resolve_poly_union :: proc(ast_context: ^AstContext, poly_params: ^ast.Field_Lis for arg, i in call_expr.args { if ident, ok := arg.derived.(^ast.Ident); ok { if expr, ok := poly_map[ident.name]; ok { - symbol_value.types[i] = expr + call_expr.args[i] = expr } } } diff --git a/tests/hover_test.odin b/tests/hover_test.odin index 02cde4e..df65f3a 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -6034,6 +6034,27 @@ ast_hover_constant_unary_expr :: proc(t: ^testing.T) { } test.expect_hover(t, &source, "test.FOO :: ~u32(0)") } + +@(test) +ast_hover_union_multiple_poly :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + Foo :: struct($T: typeid) {} + Bar :: struct{} + + Bazz :: union($T: typeid) { + Foo(T), + Bar, + } + + main :: proc() { + T :: distinct int + bazz: Ba{*}zz(T) + } + `, + } + test.expect_hover(t, &source, "test.Bazz :: union(T) {\n\tFoo(T),\n\tBar,\n}") +} /* Waiting for odin fix -- cgit v1.2.3