Typesafe type aliases, first draft 100 lines and not working, second draw 2 lines

and working 100%
This commit is contained in:
Krzosa Karol
2022-06-12 12:56:31 +02:00
parent 526967abbd
commit beb10d6e2d
2 changed files with 2 additions and 0 deletions

View File

@@ -965,6 +965,7 @@ resolve_decl(Ast_Decl *ast){
node->value = op.value;
if(op.value.type == type_type){
node->kind = AST_TYPE;
node->type_val = type_copy(pctx->perm, node->type_val);
} else if(is_lambda(op.value.type)){
node->kind = AST_LAMBDA;
}

View File

@@ -126,6 +126,7 @@ type_pointer(Ast_Type *base){
if(!result){
result = type_new(pctx->perm, TYPE_POINTER, pointer_size, pointer_align);
result->base = base;
result->is_unsigned = true;
map_insert(&pctx->type_map, base, result);
}
assert(result->kind == TYPE_POINTER);