Typesafe type aliases, first draft 100 lines and not working, second draw 2 lines
and working 100%
This commit is contained in:
@@ -965,6 +965,7 @@ resolve_decl(Ast_Decl *ast){
|
|||||||
node->value = op.value;
|
node->value = op.value;
|
||||||
if(op.value.type == type_type){
|
if(op.value.type == type_type){
|
||||||
node->kind = AST_TYPE;
|
node->kind = AST_TYPE;
|
||||||
|
node->type_val = type_copy(pctx->perm, node->type_val);
|
||||||
} else if(is_lambda(op.value.type)){
|
} else if(is_lambda(op.value.type)){
|
||||||
node->kind = AST_LAMBDA;
|
node->kind = AST_LAMBDA;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ type_pointer(Ast_Type *base){
|
|||||||
if(!result){
|
if(!result){
|
||||||
result = type_new(pctx->perm, TYPE_POINTER, pointer_size, pointer_align);
|
result = type_new(pctx->perm, TYPE_POINTER, pointer_size, pointer_align);
|
||||||
result->base = base;
|
result->base = base;
|
||||||
|
result->is_unsigned = true;
|
||||||
map_insert(&pctx->type_map, base, result);
|
map_insert(&pctx->type_map, base, result);
|
||||||
}
|
}
|
||||||
assert(result->kind == TYPE_POINTER);
|
assert(result->kind == TYPE_POINTER);
|
||||||
|
|||||||
Reference in New Issue
Block a user