aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-06-21 23:11:14 +0100
committergingerBill <bill@gingerbill.org>2019-06-21 23:11:14 +0100
commitfd62959bf4876d86edf5ebc507ff16167da28469 (patch)
treef8ecd351305e073491577d0ab785a2ef62754182 /src/checker.cpp
parent8b8cada33e19e8c2690340d2dd547535de48d94c (diff)
Fix procedure constant declaration value type assignment checking
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp3
1 files changed, 2 insertions, 1 deletions
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;