Branch: Tag:

2020-08-24

2020-08-24 09:52:18 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler [Typechecker]: Improved handling of union (aka or) types.

Now that low_match_types() adds a reference to its result, we can
return the matching types for both parts of a union type.

3818:    {    struct pike_type *t = low_match_types(a->cdr, b, flags);    if (t) { +  type_stack_mark(); +  push_finished_type(ret); +  push_finished_type(t); +  push_type(T_OR); +  free_type(ret);    free_type(t); -  +  ret = pop_unfinished_type();    }    return ret;    }else{
3945:    {    struct pike_type *t = low_match_types(a, b->cdr, flags);    if (t) { +  type_stack_mark(); +  push_finished_type(ret); +  push_finished_type(t); +  push_type(T_OR); +  free_type(ret);    free_type(t); -  +  ret = pop_unfinished_type();    }    return ret;    }else{