From fd62959bf4876d86edf5ebc507ff16167da28469 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 21 Jun 2019 23:11:14 +0100 Subject: Fix procedure constant declaration value type assignment checking --- src/checker.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/checker.cpp') diff --git a/src/checker.cpp b/src/checker.cpp index 4712876de..9abd8c499 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -2591,7 +2591,7 @@ void check_collect_value_decl(CheckerContext *c, Ast *decl) { pl->type->ProcType.calling_convention = cc; } d->proc_lit = init; - d->type_expr = pl->type; + d->type_expr = vd->type; } else if (init->kind == Ast_ProcGroup) { ast_node(pg, ProcGroup, init); e = alloc_entity_proc_group(d->scope, token, nullptr); @@ -2599,6 +2599,7 @@ void check_collect_value_decl(CheckerContext *c, Ast *decl) { error(name, "Procedure groups are not allowed within a foreign block"); } d->init_expr = init; + d->type_expr = vd->type; } else { e = alloc_entity_constant(d->scope, token, nullptr, empty_exact_value); d->type_expr = vd->type; -- cgit v1.2.3