Branch: Tag:

2016-10-30

2016-10-30 11:40:44 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler [Type checker]: Added check_variant_overload().

This function is intended to be used to check whether all variants
of a variant function are reachable.

4430:    b = b->cdr;       /* check the returntype */ +  if (flags & LE_TYPE_SVALUE) return 1;    /* FIXME: Check array_cnt */    if ((b->type != T_VOID) && (a->type != T_VOID)) {    if(!low_pike_types_le(a, b, array_cnt, flags)) return 0;
4444:    switch(a->type)    {    case T_MAPPING: +  if (flags & LE_TYPE_SVALUE) return 1;    /*    * mapping(A:B) <= mapping(C:D) iff A <= C && B <= D.    */
4548:    case T_MULTISET:    case T_ARRAY:    case T_STRING: +  if (flags & LE_TYPE_SVALUE) return 1;    a = a->car;    b = b->car;    array_cnt = 0;
4714:    return low_pike_types_le(a, b, 0, 0);   }    + int check_variant_overload(struct pike_type *a, struct pike_type *b) + { +  clear_markers(); +  return !low_pike_types_le(b, a, 0, LE_TYPE_SVALUE); + }      #ifdef DEBUG_MALLOC   #define low_index_type(X,Y,Z) ((struct pike_type *)debug_malloc_pass(debug_low_index_type((X),(Y),(Z))))