Branch: Tag:

2020-08-15

2020-08-15 10:58:52 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler [Typechecker]: Fixed issue where markers were not expanded.

Fixes multiple erroneous warnings. Eg

Pike v8.1 release 13 running Hilfe v3.5 (Incremental Pike Frontend)
> array a = ({ `+, `-, `/ });
Compiler Warning: 1: Expected object implementing lfun `+.
Compiler Warning: 1: Got : 2.

Also adjusts the warning message somewhat (for when it is relevant) to

Compiler Warning: 1: Expected object implementing lfun::`+().

3605:    ref_push_string(lfun_strings[lfun]);    yytype_report(REPORT_WARNING, NULL, 0, NULL,    NULL, 0, t, -  1, "Expected object implementing lfun %s."); +  1, "Expected object implementing lfun::%s().");    }    break;    }
3635:    ref_push_string(lfun_strings[lfun]);    yytype_report(REPORT_WARNING, NULL, 0, NULL,    NULL, 0, t, -  1, "Expected object implementing lfun %s."); +  1, "Expected object implementing lfun::%s().");    break;    }   
3859:       case PIKE_T_OPERATOR:    { -  struct pike_type *t = apply_type_operator(a->type, a->car, a->cdr); +  struct pike_type *t = a->car; +  if ((t->type >= '0') && (t->type <= '9')) { +  t = a_markers[t->type - '0']; +  if (!t) t = zero_type_string; +  } +  t = apply_type_operator(a->type, t, a->cdr);    ret = low_match_types(t, b, flags);    free_type(t);    return ret;
3959:       case PIKE_T_OPERATOR:    { -  struct pike_type *t = apply_type_operator(b->type, b->car, b->cdr); +  struct pike_type *t = b->car; +  if ((t->type >= '0') && (t->type <= '9')) { +  t = b_markers[t->type - '0']; +  if (!t) t = zero_type_string; +  } +  t = apply_type_operator(b->type, t, b->cdr);    ret = low_match_types(a, t, flags);    free_type(t);    return ret;
4485:       case PIKE_T_OPERATOR:    { -  struct pike_type *t = apply_type_operator(b->type, b->car, b->cdr); +  struct pike_type *t = b->car; +  if ((t->type >= '0') && (t->type <= '9')) { +  t = ((flags & LE_A_B_SWAPPED)?a_markers:b_markers)[t->type - '0']; +  if (!t) t = zero_type_string; +  } +  t = apply_type_operator(b->type, t, b->cdr);    ret = low_pike_types_le(a, t, array_cnt, flags);    free_type(t);    return ret;
4706:       case PIKE_T_OPERATOR:    { -  struct pike_type *t = apply_type_operator(a->type, a->car, a->cdr); +  struct pike_type *t = a->car; +  if ((t->type >= '0') && (t->type <= '9')) { +  t = ((flags & LE_A_B_SWAPPED)?b_markers:a_markers)[t->type - '0']; +  if (!t) t = zero_type_string; +  } +  t = apply_type_operator(a->type, t, a->cdr);    ret = low_pike_types_le(t, b, array_cnt, flags);    free_type(t);    return ret;