Branch: Tag:

2016-01-11

2016-01-11 21:24:46 by Martin Nilsson <nilsson@fastmail.com>

Allow casting of objects to mapping.

473:    struct object *o = sp[-1].u.object;    int f = FIND_LFUN(o->prog->inherits[SUBTYPEOF(sp[-1])].prog, LFUN_CAST);    if(f == -1) { +  if (run_time_type == T_MAPPING) { +  stack_dup(); +  f_indices(1); +  stack_swap(); +  f_values(1); +  f_mkmapping(2); +  goto emulated_type_ok; +  }    if (run_time_type != T_PROGRAM) {    Pike_error("No cast method in object.\n");    }