mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-13 17:32:22 -07:00
Fix "Polymorphic parameter declared in return type doesn't compile #464" by giving a conversion error (code wasn't handling polymorphic result types as intended)
This commit is contained in:
@@ -2507,6 +2507,16 @@ bool check_procedure_type(CheckerContext *ctx, Type *type, Ast *proc_type_node,
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (isize i = 0; i < result_count; i++) {
|
||||
Entity *e = results->Tuple.variables[i];
|
||||
if (e->kind != Entity_Variable) {
|
||||
is_polymorphic = true;
|
||||
break;
|
||||
} else if (is_type_polymorphic(e->type)) {
|
||||
is_polymorphic = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
type->Proc.is_polymorphic = is_polymorphic;
|
||||
|
||||
return success;
|
||||
|
||||
Reference in New Issue
Block a user