From b0a4e5b90dd6ecc91bc7b23aceb6f89e67e6d497 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Sun, 3 Dec 2023 18:03:43 -0600 Subject: [PATCH] fixed: ability to `#export` things that are not procedures --- compiler/src/checker.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/src/checker.c b/compiler/src/checker.c index b0bc672a..2d7f0126 100644 --- a/compiler/src/checker.c +++ b/compiler/src/checker.c @@ -3477,6 +3477,11 @@ CheckStatus check_process_directive(AstNode* directive) { if (exported->entity && exported->entity->state <= Entity_State_Check_Types) YIELD(directive->token->pos, "Waiting for exported type to be known."); + if (exported->kind != Ast_Kind_Function) { + onyx_report_error(export->token->pos, Error_Critical, "Cannot export something that is not a procedure."); + ERROR(exported->token->pos, "Here is the thing being exported that is not a procedure."); + } + CHECK(expression, &export->export_name_expr); if (export->export_name_expr->kind != Ast_Kind_StrLit) { -- 2.25.1