diff options
| author | gingerBill <bill@gingerbill.org> | 2018-11-11 17:08:30 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-11-11 17:08:30 +0000 |
| commit | b55b1ffe14bc4a7459cd9b9bdb8b9b0c8f7f8091 (patch) | |
| tree | 77df172a7e387801f9f43999dcc412a6fb5b71be /src/check_expr.cpp | |
| parent | 620d5d34f7c5712be27a92e1ab6ab48119f0a4c6 (diff) | |
`opaque` keyword and type
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 6b2a07a86..61bf9eeca 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -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); |