Merge pull request #500 from SSStormy/fix-string_to_enum_value

Fix 'fmt.string_to_enum_value' not compiling
This commit is contained in:
gingerBill
2019-12-15 09:38:37 +00:00
committed by GitHub
+2 -2
View File
@@ -837,8 +837,8 @@ enum_value_to_string :: proc(val: any) -> (string, bool) {
}
string_to_enum_value :: proc($T: typeid, s: string) -> (T, bool) {
ti := type_info_base(type_info_of(T));
if e, ok := ti.variant.(Type_Info_Enum); ok {
ti := runtime.type_info_base(type_info_of(T));
if e, ok := ti.variant.(runtime.Type_Info_Enum); ok {
for str, idx in e.names {
if s == str {
// NOTE(bill): Unsafe cast