diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-06-05 21:20:02 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-06-05 21:20:02 -0400 |
| commit | 24e32736b3c19b541a810e07927db50d71e07423 (patch) | |
| tree | d1626db02ab4f255806fac323fc386163b60ca53 | |
| parent | e81770b1ededb36770fd2393feb2d4450df445ef (diff) | |
Fix definition and hover for union enum types
| -rw-r--r-- | src/server/analysis.odin | 7 | ||||
| -rw-r--r-- | 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 |