mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-17 11:22:22 -07:00
Fixed demo
This commit is contained in:
+5
-10
@@ -1448,19 +1448,10 @@ void check_procedure_overloading(Checker *c, Entity *e) {
|
||||
|
||||
TokenPos pos = q->token.pos;
|
||||
|
||||
if (q->type == NULL) {
|
||||
if (q->type == NULL || q->type == t_invalid) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_type_proc(q->type)) {
|
||||
TypeProc *ptq = &base_type(q->type)->Proc;
|
||||
if (ptq->is_generic) {
|
||||
q->type = t_invalid;
|
||||
error(q->token, "Polymorphic procedure `%.*s` cannot be overloaded", LIT(name));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
ProcTypeOverloadKind kind = are_proc_types_overload_safe(p->type, q->type);
|
||||
switch (kind) {
|
||||
case ProcOverload_Identical:
|
||||
@@ -1480,6 +1471,10 @@ void check_procedure_overloading(Checker *c, Entity *e) {
|
||||
error(p->token, "Overloaded procedure `%.*s` as the same parameters but different results in this scope", LIT(name));
|
||||
is_invalid = true;
|
||||
break;
|
||||
case ProcOverload_Polymorphic:
|
||||
error(p->token, "Overloaded procedure `%.*s` has a polymorphic counterpart in this scope which is not allowed", LIT(name));
|
||||
is_invalid = true;
|
||||
break;
|
||||
case ProcOverload_ParamCount:
|
||||
case ProcOverload_ParamTypes:
|
||||
// This is okay :)
|
||||
|
||||
Reference in New Issue
Block a user