Disable polymorphic overloading in the global scope

TODO: Figure out why it does not work in the global scope
This commit is contained in:
Ginger Bill
2017-07-02 22:08:39 +01:00
parent 96d32680fe
commit bc16b290ba
12 changed files with 276 additions and 222 deletions
+15 -11
View File
@@ -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");
}
}
}
}