From 5d397804f7c02a2a71a10dd3af2f59a1bb3b4a10 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 16 Jan 2023 13:22:37 +0000 Subject: Fix #2286 by printing an error correctly --- src/check_type.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/check_type.cpp') diff --git a/src/check_type.cpp b/src/check_type.cpp index ad746514e..ec661134b 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -1655,6 +1655,12 @@ gb_internal Type *check_get_params(CheckerContext *ctx, Scope *scope, Ast *_para } else if (!ctx->no_polymorphic_errors) { // NOTE(bill): The type should be determined now and thus, no need to determine the type any more is_type_polymorphic_type = false; + Entity *proc_entity = entity_from_expr(op.expr); + if ((proc_entity != nullptr) && (op.value.kind == ExactValue_Procedure)) { + if (is_type_polymorphic(proc_entity->type, false)) { + error(op.expr, "Cannot determine complete type of partial polymorphic procedure"); + } + } } } if (is_poly_name) { -- cgit v1.2.3