mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Fix __get_map_key
This commit is contained in:
@@ -816,7 +816,8 @@ __get_map_header :: proc "contextless" (m: ^$T/map[$K]$V) -> Map_Header {
|
|||||||
return header;
|
return header;
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_map_key :: proc "contextless" (key: $K) -> Map_Key {
|
__get_map_key :: proc "contextless" (k: $K) -> Map_Key {
|
||||||
|
key := k;
|
||||||
map_key: Map_Key;
|
map_key: Map_Key;
|
||||||
ti := type_info_base_without_enum(type_info_of(K));
|
ti := type_info_base_without_enum(type_info_of(K));
|
||||||
switch _ in ti.variant {
|
switch _ in ti.variant {
|
||||||
|
|||||||
@@ -946,7 +946,12 @@ deferred_procedure_associations :: proc() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
main :: proc() {
|
main :: proc() {
|
||||||
when true {
|
x: map[int]int;
|
||||||
|
x[123] = 123;
|
||||||
|
fmt.println(x);
|
||||||
|
fmt.println(x[123]);
|
||||||
|
|
||||||
|
when false {
|
||||||
general_stuff();
|
general_stuff();
|
||||||
union_type();
|
union_type();
|
||||||
parametric_polymorphism();
|
parametric_polymorphism();
|
||||||
|
|||||||
Reference in New Issue
Block a user