mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-18 20:40:28 +00:00
fix specific_union_variant in map_keyed_by_union not converting to union type
This commit is contained in:
@@ -317,3 +317,23 @@ set_delete_random_key_value :: proc(t: ^testing.T) {
|
||||
seed_incr += 1
|
||||
}
|
||||
}
|
||||
|
||||
@test
|
||||
test_union_key_should_not_be_hashing_specifc_variant :: proc(t: ^testing.T) {
|
||||
Vec2 :: [2]f32
|
||||
BoneId :: distinct int
|
||||
VertexId :: distinct int
|
||||
Id :: union {
|
||||
BoneId,
|
||||
VertexId,
|
||||
}
|
||||
|
||||
m: map[Id]Vec2
|
||||
defer delete(m)
|
||||
|
||||
bone_1: BoneId = 69
|
||||
m[bone_1] = {4, 20}
|
||||
|
||||
testing.expect_value(t, bone_1 in m, true)
|
||||
testing.expect_value(t, Id(bone_1) in m, true)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user