pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:3510:    break;       case F_APPEND_ARRAY:    if (!CAR(n) || (CAR(n)->type == void_type_string)) {    yyerror("Assigning a void expression.");    copy_pike_type(n->type, void_type_string);    } else if (!CDR(n)) {    copy_pike_type(n->type, CAR(n)->type);    } else {    struct pike_type *tmp; -  /* Ensure that the type-fields are up to date. */ -  fix_type_field(CAR(n)); -  fix_type_field(CDR(n)); +     type_stack_mark();    push_finished_type(CDR(n)->type);    push_type(T_ARRAY);    n->type = and_pike_types(CAR(n)->type, tmp = pop_unfinished_type());    free_type(tmp);    }    break;       case F_ASSIGN:    case F_ASSIGN_SELF:    if (!CDR(n) || (CDR(n)->type == void_type_string)) {    yyerror("Assigning a void expression.");    copy_pike_type(n->type, void_type_string);    } else if (!CAR(n)) {    copy_pike_type(n->type, CDR(n)->type);    } else { -  /* Ensure that the type-fields are up to date. */ +     struct pike_type *t; -  fix_type_field(CDR(n)); -  fix_type_field(CAR(n)); +     if( CDR(n)->type->type == PIKE_T_AUTO )    {    /* Update to actual type (assign from soft-cast to auto). */    free_type( CDR(n)->type );    copy_pike_type( CDR(n)->type, CAR(n)->type );       /* potential extension: fix general case:    auto z;    z = 1;    z= 10;