Update demo for both subtyping and union based Entity

This commit is contained in:
Ginger Bill
2017-07-10 23:28:53 +01:00
parent 3868a9a0f0
commit 115e6e7f9e
2 changed files with 102 additions and 91 deletions

View File

@@ -3338,6 +3338,7 @@ bool check_is_castable_to(Checker *c, Operand *operand, Type *y) {
// Cast between pointers
if (is_type_pointer(src) && is_type_pointer(dst)) {
#if 0
Type *s = base_type(type_deref(src));
if (is_type_union(s)) {
// NOTE(bill): Should the error be here?!
@@ -3349,6 +3350,7 @@ bool check_is_castable_to(Checker *c, Operand *operand, Type *y) {
gb_string_free(xs);
return false;
}
#endif
return true;
}