diff --git a/new_resolve.cpp b/new_resolve.cpp index 4142790..5ec02ee 100644 --- a/new_resolve.cpp +++ b/new_resolve.cpp @@ -269,7 +269,7 @@ resolve_expr(Ast_Expr *ast, Ast_Resolved_Type *expected_type, Sym *const_sym){ result.is_const = true; } else if(sym->kind == SYM_CONST || sym->kind == SYM_VAR){ - type_complete(sym->type); + // if(sym->type == type_type) type_complete(sym->type_val); result.type = sym->type; result.is_const = sym->kind == SYM_CONST ? true : false; result.value = sym->value; @@ -494,6 +494,7 @@ resolve_binding(Ast *ast, Sym *sym){ Ast_Resolved_Type *type = resolve_typespec(node->typespec, AST_CAN_BE_NULL); Operand expr = node->expr ? resolve_expr(node->expr, type) : Operand{}; expr.type = resolve_type_pair(node->pos, type, expr.type); + type_complete(expr.type); return expr; BREAK(); } diff --git a/structs.kl b/structs.kl index 4c56227..2245b67 100644 --- a/structs.kl +++ b/structs.kl @@ -1,6 +1,10 @@ arena_pointer: *Arena = null +thing: Arena +no_type := thing + Arena :: struct + // arena: Arena next: *Arena data: *int len : int @@ -12,8 +16,6 @@ String16 :: struct data: *void len : int -thing: Arena -no_type := thing with_type: Arena = thing pointer := &with_type deref := *pointer