mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-04 20:17:48 +00:00
opaque keyword and type
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user