Branch: Tag:

2022-02-19

2022-02-19 12:51:55 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler [Typechecker]: mixed is a superset of all types except void.

Types like array(int|mixed) should now become array(mixed).

Also removes promotion of __unknown__ to void in an obscure case.

3465:   #endif    if(!t1)    { -  if(!t2) -  push_type(T_VOID); -  else +     push_finished_type(t2);    } -  else if((!t2) -  || (t2->type == T_ZERO && zero_implied) -  -  ) +  else if((!t2) || (t2->type == T_ZERO && zero_implied))    {    push_finished_type(t1);    }
3484:    else if (t1 == t2) {    push_finished_type(t1);    } +  else if ((t1->type == T_MIXED) && (t2->type != T_VOID)) { +  push_finished_type(t1); +  if (t2->flags & PT_FLAG_VOIDABLE) { +  push_type(T_VOID); +  push_type(T_OR); +  } +  } else if ((t2->type == T_MIXED) && (t1->type != T_VOID)) { +  push_finished_type(t2); +  if (t1->flags & PT_FLAG_VOIDABLE) { +  push_type(T_VOID); +  push_type(T_OR); +  } +  }    else if ((t1->type == T_OR) || (t2->type == T_OR)) {    int on_stack = 0;    type_stack_mark();