opaque keyword and type

This commit is contained in:
gingerBill
2018-11-11 17:08:30 +00:00
parent 620d5d34f7
commit b55b1ffe14
13 changed files with 177 additions and 5 deletions

View File

@@ -1911,6 +1911,13 @@ bool check_is_castable_to(CheckerContext *c, Operand *operand, Type *y) {
return true;
}
if (is_type_opaque(src)) {
return are_types_identical(dst, src->Opaque.elem);
}
if (is_type_opaque(dst)) {
return are_types_identical(dst->Opaque.elem, src);
}
return false;
}
@@ -6602,6 +6609,11 @@ gbString write_expr_to_string(gbString str, Ast *node) {
str = write_expr_to_string(str, ht->type);
case_end;
case_ast_node(ht, OpaqueType, node);
str = gb_string_appendc(str, "opaque ");
str = write_expr_to_string(str, ht->type);
case_end;
case_ast_node(pt, PolyType, node);
str = gb_string_append_rune(str, '$');
str = write_expr_to_string(str, pt->type);