diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-07-02 22:08:39 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-07-02 22:08:39 +0100 |
| commit | bc16b290ba6c2168baf1153b4c7691e679f68b46 (patch) | |
| tree | b18d799bde62c727111f042c0813a18e362e674a /src/types.cpp | |
| parent | 96d32680fe1b83ec943382efb8e91c7029f0621f (diff) | |
Disable polymorphic overloading in the global scope
TODO: Figure out why it does not work in the global scope
Diffstat (limited to 'src/types.cpp')
| -rw-r--r-- | src/types.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/types.cpp b/src/types.cpp index d49dd6a86..8d7466a32 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -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"); + } } } } |