Branch: Tag:

2022-01-16

2022-01-16 13:29:16 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler [Typechecker]: Improved checking of splice operator some more.

4025:    yytype_report(REPORT_ERROR, NULL, 0, array_type_string,    NULL, 0, CAR(n)->type,    0, "Bad argument to splice operator."); - #if 0 +  array_type = array_type_string; +  add_ref(array_type);    } else if ((array_type != CAR(n)->type) &&    (THIS_COMPILATION->lex.pragmas & ID_STRICT_TYPES) &&    (Pike_compiler->compiler_pass == COMPILER_PASS_LAST)) { -  +  struct pike_type *diff_type = +  type_binop(PT_BINOP_MINUS, CAR(n)->type, array_type_string, 0, 0, 0); +  if (diff_type) {    yytype_report(REPORT_WARNING, NULL, 0, array_type, -  NULL, 0, CAR(n)->type, +  NULL, 0, diff_type,    0, "Bad argument to splice operator."); - #endif +  free_type(diff_type);    } -  +  }    /* FIXME: The type field of the splice operator is not yet utilized.    *    * It probably ought to be something similar to MANY(..., VOID).