aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBradley Lewis <22850972+BradLewis@users.noreply.github.com>2026-02-10 19:48:25 +1100
committerGitHub <noreply@github.com>2026-02-10 19:48:25 +1100
commit4b7287a93d6896de0ea27eb159aba10f09203456 (patch)
treeaea15ca12150f13a0e5deb8bbddfff00015849ba
parentc03e7050673957ecae5bd7f35a386312a7f825a8 (diff)
parent1b5e31443062db82337848f112d26ac3a71b80b9 (diff)
Merge pull request #1290 from BradLewis/fix/overloaded-parapoly-proc-with-bitfield
Correctly resolve parapoly overloaded procs using bitfields
-rw-r--r--src/server/analysis.odin2
-rw-r--r--tests/hover_test.odin30
2 files changed, 31 insertions, 1 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index c9cd863..6d0cf09 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -438,7 +438,7 @@ is_symbol_same_typed :: proc(ast_context: ^AstContext, a, b: Symbol, flags: ast.
case SymbolBasicValue:
b_value := b.value.(SymbolBasicValue)
return a_value.ident.name == b_value.ident.name && a.pkg == b.pkg
- case SymbolStructValue, SymbolEnumValue, SymbolUnionValue, SymbolBitSetValue:
+ case SymbolStructValue, SymbolEnumValue, SymbolUnionValue, SymbolBitSetValue, SymbolBitFieldValue:
return a.name == b.name && a.pkg == b.pkg
case SymbolSliceValue:
b_value := b.value.(SymbolSliceValue)
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index 5dc6c91..35c2c4f 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -6075,6 +6075,36 @@ ast_hover_poly_proc_passthrough :: proc(t: ^testing.T) {
}
test.expect_hover(t, &source, "test.value: int")
}
+
+@(test)
+ast_hover_parapoly_overloaded_proc_with_bitfield :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Entry :: struct($T, $H: typeid) {
+ handle: H,
+ }
+
+ SmallHandle :: bit_field int {
+ valid: bool | 1,
+ generation: int | 7,
+ index: int | 24,
+ }
+
+ make :: proc {
+ makeEntry,
+ }
+
+ makeEntry :: proc($T: typeid/Entry($D, $H), handle: H) -> (entry: T) {
+ return
+ }
+
+ main :: proc() {
+ e{*}ntry := make(Entry(int, SmallHandle), SmallHandle{})
+ }
+ `,
+ }
+ test.expect_hover(t, &source, "test.entry: test.Entry(int, SmallHandle)")
+}
/*
Waiting for odin fix