Branch: Tag:

2012-02-17

2012-02-17 12:54:40 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Typechecker: Zero should not be implicit when checking inverted types.

58:   #define LE_A_B_GROUPED 12 /* Both the above two flags. */   #endif   #define LE_USE_HANDLERS 16 /* Call handlers if appropriate. */ + #define LE_EXPLICIT_ZERO 32 /* Zero is not subtype of all others. */      /*    * Flags used by low_get_first_arg_type()
4286:    /* void <= zero <= any_type */    if (array_cnt >= 0) {    /* !array(zero) */ +  if (!(flags & LE_EXPLICIT_ZERO) || +  ((b->type == T_INT) && !array_cnt)) {    return 1;    }    } -  +  }       if (b->type == T_ZERO) {    if (array_cnt <= 0) {
6249:    arg_type = zero_type_string;    }    -  if (!(/*(flags & CALL_INVERTED_TYPES)? -  low_pike_types_le(tmp2, arg_type, 0, LE_A_B_SWAPPED): */ +  if (!((flags & CALL_INVERTED_TYPES)? +  low_pike_types_le(tmp2, arg_type, 0, +  LE_A_B_SWAPPED|LE_EXPLICIT_ZERO):    low_pike_types_le(arg_type, tmp2, 0, 0)) &&    ((flags & CALL_STRICT) ||    !low_match_types(arg_type, tmp2, NO_SHORTCUTS))) {