pike.git/
src/
operators.c
Branch:
Tag:
Non-build tags
All tags
No tags
2016-01-11
2016-01-11 21:24:46 by Martin Nilsson <nilsson@fastmail.com>
3f307572fccf074fa07abbe401488943337f6f7a (
9
lines) (+
9
/-
0
)
[
Show
|
Annotate
]
Branch:
8.1
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"); }