diff options
| author | gingerBill <bill@gingerbill.org> | 2019-11-05 19:37:19 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-11-05 19:37:19 +0000 |
| commit | a634444f99dca486673b8575a136dd99886ffb8a (patch) | |
| tree | 7f52260c3d5c71460d70864a3a411e2944005b7f /src/check_type.cpp | |
| parent | 40546fbde27601c147f5c64d9c1138a5a40bb3b8 (diff) | |
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)
Diffstat (limited to 'src/check_type.cpp')
| -rw-r--r-- | src/check_type.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp index 9f8310e44..c733cfb4c 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -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; |