mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-16 02:42:22 -07:00
Disable polymorphic overloading in the global scope
TODO: Figure out why it does not work in the global scope
This commit is contained in:
+15
-11
@@ -1354,15 +1354,14 @@ ProcTypeOverloadKind are_proc_types_overload_safe(Type *x, Type *y) {
|
||||
TypeProc py = base_type(y)->Proc;
|
||||
|
||||
|
||||
if (px.is_polymorphic != py.is_polymorphic) {
|
||||
return ProcOverload_Polymorphic;
|
||||
}
|
||||
|
||||
|
||||
// if (px.calling_convention != py.calling_convention) {
|
||||
// return ProcOverload_CallingConvention;
|
||||
// }
|
||||
|
||||
// if (px.is_polymorphic != py.is_polymorphic) {
|
||||
// return ProcOverload_Polymorphic;
|
||||
// }
|
||||
|
||||
if (px.param_count != py.param_count) {
|
||||
return ProcOverload_ParamCount;
|
||||
}
|
||||
@@ -1379,6 +1378,11 @@ ProcTypeOverloadKind are_proc_types_overload_safe(Type *x, Type *y) {
|
||||
return ProcOverload_ParamVariadic;
|
||||
}
|
||||
|
||||
|
||||
if (px.is_polymorphic != py.is_polymorphic) {
|
||||
return ProcOverload_Polymorphic;
|
||||
}
|
||||
|
||||
if (px.result_count != py.result_count) {
|
||||
return ProcOverload_ResultCount;
|
||||
}
|
||||
@@ -2448,12 +2452,12 @@ gbString write_type_to_string(gbString str, Type *type) {
|
||||
}
|
||||
} else {
|
||||
GB_ASSERT(var->kind == Entity_TypeName);
|
||||
#if 0
|
||||
str = gb_string_appendc(str, "type/");
|
||||
str = write_type_to_string(str, var->type);
|
||||
#else
|
||||
str = gb_string_appendc(str, "type");
|
||||
#endif
|
||||
if (var->type->kind == Type_Generic) {
|
||||
str = gb_string_appendc(str, "type/");
|
||||
str = write_type_to_string(str, var->type);
|
||||
} else {
|
||||
str = gb_string_appendc(str, "type");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user