aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/analysis.odin7
-rw-r--r--tests/hover_test.odin2
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