aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorPhil <homan.phil@gmail.com>2022-09-06 11:02:53 -0700
committerPhil <homan.phil@gmail.com>2022-09-06 11:04:18 -0700
commit86b6d01242b01bf76127fe1f7fd2823b6e2e99e7 (patch)
treec85e4b175950e8f78abce7dee0f747853343fb6b /src/check_type.cpp
parent826a3b3012b781c972d3550b3999f6a9b4a09508 (diff)
fix polymorphic proc parameters error handling
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index da0a9706b..66417f97e 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -1643,8 +1643,10 @@ Type *check_get_params(CheckerContext *ctx, Scope *scope, Ast *_params, bool *is
bool valid = false;
if (is_type_proc(op.type)) {
Entity *proc_entity = entity_from_expr(op.expr);
- valid = proc_entity != nullptr;
- poly_const = exact_value_procedure(proc_entity->identifier.load() ? proc_entity->identifier.load() : op.expr);
+ valid = (proc_entity != nullptr) && (op.value.kind == ExactValue_Procedure);
+ if (valid) {
+ poly_const = exact_value_procedure(proc_entity->identifier.load() ? proc_entity->identifier.load() : op.expr);
+ }
}
if (!valid) {
if (op.mode == Addressing_Constant) {