From: Brendan Hansen Date: Mon, 4 Dec 2023 00:03:43 +0000 (-0600) Subject: fixed: ability to `#export` things that are not procedures X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=b0a4e5b90dd6ecc91bc7b23aceb6f89e67e6d497;p=onyx.git fixed: ability to `#export` things that are not procedures --- 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) {