Fix returning functions

This commit is contained in:
Nathan Braswell
2016-07-01 00:08:41 -04:00
parent 4bf8572d21
commit b4d0d20883

View File

@@ -955,7 +955,7 @@ obj interpreter (Object) {
// unless it's an object // unless it's an object
var from_real = get_real_value(from) var from_real = get_real_value(from)
// NOTE: store_into_variable takes to in as a ref because it might change it in the special case ref = ptr // NOTE: store_into_variable takes to in as a ref because it might change it in the special case ref = ptr
if (is_object_like(from_real)) if (is_object_like(from_real) || is_function(from_real))
store_into_variable(to, from_real) store_into_variable(to, from_real)
else else
store_into_variable(to, cast_value(from_real, to.variable.second)) store_into_variable(to, cast_value(from_real, to.variable.second))