From db91cf09fcf9bb54012d68a27589ee9597dae6e4 Mon Sep 17 00:00:00 2001 From: tocariimaa Date: Tue, 21 Jan 2025 14:36:18 -0300 Subject: [PATCH] sema: use ast field here, add assertion --- compiler/sema.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/sema.c b/compiler/sema.c index 3ddcc07..2736a40 100644 --- a/compiler/sema.c +++ b/compiler/sema.c @@ -709,10 +709,11 @@ sema_var_decl(SemaCtx *sctx, AstVarDecl *decl, Location loc) compiler_assert(sctx->cm, dexpr_dt != nil); decl->type = dexpr_dt; } + compiler_assert(sctx->cm, decl->type != nil); Symbol sym = { .kind = decl->kind, - .dtype = dtype, + .dtype = decl->type, .loc = loc, }; /* Insert the variable to the symbol table */