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 */