From 24e32736b3c19b541a810e07927db50d71e07423 Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Thu, 5 Jun 2025 21:20:02 -0400 Subject: Fix definition and hover for union enum types --- src/server/analysis.odin | 7 ++++--- tests/hover_test.odin | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/server/analysis.odin b/src/server/analysis.odin index 7f0007e..668260b 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -3727,9 +3727,10 @@ unwrap_super_enum :: proc( for type in symbol_union.types { symbol := resolve_type_expression(ast_context, type) or_return - value := symbol.value.(SymbolEnumValue) or_return - append(&names, ..value.names) - append(&ranges, ..value.ranges) + if value, ok := symbol.value.(SymbolEnumValue); ok { + append(&names, ..value.names) + append(&ranges, ..value.ranges) + } } ret_value.names = names[:] diff --git a/tests/hover_test.odin b/tests/hover_test.odin index 028fbdb..bdd583a 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -402,7 +402,7 @@ ast_hover_union_implicit_selector :: proc(t: ^testing.T) { Foo2, } - Bar :: union { Foo } + Bar :: union { Foo, int } bar: Bar bar = .Fo{*}o1 -- cgit v1.2.3