diff options
| author | gingerBill <bill@gingerbill.org> | 2022-05-30 15:27:09 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-05-30 15:27:09 +0100 |
| commit | 5b42dd7707a8921321958934cf5d75ada1d8a006 (patch) | |
| tree | 6aec2cbfbd3b21980dbb4df1371acce5bf2a708b /src/check_stmt.cpp | |
| parent | 51707032d10d166094959d49e597b322a8d7c55d (diff) | |
Correct `@(require_results)` on parapoly procedures
Diffstat (limited to 'src/check_stmt.cpp')
| -rw-r--r-- | src/check_stmt.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index f2c830c1b..b316f940f 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -1405,12 +1405,12 @@ void check_stmt_internal(CheckerContext *ctx, Ast *node, u32 flags) { if (kind == Expr_Stmt) { return; } - Ast *expr = strip_or_return_expr(operand.expr); + Ast *expr = strip_or_return_expr(operand.expr); if (expr->kind == Ast_CallExpr) { AstCallExpr *ce = &expr->CallExpr; - Type *t = type_of_expr(ce->proc); - if (is_type_proc(t)) { + Type *t = base_type(type_of_expr(ce->proc)); + if (t->kind == Type_Proc) { if (t->Proc.require_results) { gbString expr_str = expr_to_string(ce->proc); error(node, "'%s' requires that its results must be handled", expr_str); @@ -1421,8 +1421,8 @@ void check_stmt_internal(CheckerContext *ctx, Ast *node, u32 flags) { } else if (expr->kind == Ast_SelectorCallExpr) { AstSelectorCallExpr *se = &expr->SelectorCallExpr; ast_node(ce, CallExpr, se->call); - Type *t = type_of_expr(ce->proc); - if (is_type_proc(t)) { + Type *t = base_type(type_of_expr(ce->proc)); + if (t->kind == Type_Proc) { if (t->Proc.require_results) { gbString expr_str = expr_to_string(ce->proc); error(node, "'%s' requires that its results must be handled", expr_str); |