git.s-ol.nu alive / 29a466d
fix crash when last expression in (do …) returns Constant s-ol 1 year, 3 months ago
2 changed file(s) with 6 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
250250 eval: (scope, tail) =>
251251 scope = Scope scope
252252 children = [expr\eval scope for expr in *tail]
253 last = children[#children]
254 super RTNode :children, result: last and last.result
253 result = if last = children[#children] then last.result
254 if result and result.metatype == '='
255 result = result.type\mk_sig result\unwrap!
256
257 super RTNode :children, result
255258
256259 if_ = Constant.meta
257260 meta:
128128
129129 if @result
130130 if next @side_inputs
131 assert @result.metatype != '=', "Const result has side_inputs"
131 assert @result.metatype != '=', "Const result #{@result} has side_inputs"
132132 elseif @result.metatype == '~'
133133 @result = @result.type\mk_const @result\unwrap!
134134