pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:4006:    check_node_type(CAR(n),    Pike_compiler->compiler_frame->current_return_type,    "Wrong return type.");    }    }    copy_pike_type(n->type, void_type_string);    break;       case F_CASE_RANGE:    if (CDR(n) && CAR(n) && !TEST_COMPAT(0,6)) { +  fix_type_field(CAR(n)); +  fix_type_field(CDR(n));    /* case 1 .. 2: */    if (!match_types(CAR(n)->type, CDR(n)->type)) {    if (!match_types(CAR(n)->type, int_type_string) ||    !match_types(CDR(n)->type, int_type_string)) {    yytype_report(REPORT_ERROR,    NULL, 0, CAR(n)->type,    NULL, 0, CDR(n)->type,    0, "Type mismatch in case range.");    }    } else if ((c->lex.pragmas & ID_STRICT_TYPES) &&
pike.git/src/las.c:4038:    if (!(CDR(n)->type == zero_type_string) ||    !(pike_types_le(CAR(n)->type, int_type_string))) {    yytype_report(REPORT_WARNING,    NULL, 0, CAR(n)->type,    NULL, 0, CDR(n)->type,    0, "Type mismatch in case range.");    }    }    }    } +  if (CDR(n) && (Pike_compiler->compiler_pass == 2)) { +  fix_type_field(CDR(n)); +  if (!match_types(CDR(n)->type, enumerable_type_string)) { +  yytype_report(REPORT_WARNING, +  NULL, 0, enumerable_type_string, +  NULL, 0, CDR(n)->type, +  0, "Case value is not an enumerable type."); +  } +  }    /* FALL_THROUGH */    case F_CASE: -  +  if (CAR(n) && (Pike_compiler->compiler_pass == 2)) { +  fix_type_field(CAR(n)); +  if (!match_types(CAR(n)->type, enumerable_type_string)) { +  yytype_report(REPORT_WARNING, +  NULL, 0, enumerable_type_string, +  NULL, 0, CAR(n)->type, +  0, "Case value is not an enumerable type."); +  } +  } +  /* FALL_THROUGH */    case F_INC_LOOP:    case F_DEC_LOOP:    case F_DEC_NEQ_LOOP:    case F_INC_NEQ_LOOP:    case F_LOOP:    case F_CONTINUE:    case F_BREAK:    case F_DEFAULT:    case F_POP_VALUE:    copy_pike_type(n->type, void_type_string);