From: nobu@... Date: 2014-12-11T08:10:03+00:00 Subject: [ruby-core:66775] [ruby-trunk - Bug #10586] [Rejected] function wrongly returns nil in eval() Issue #10586 has been updated by Nobuyoshi Nakada. Description updated Status changed from Open to Rejected `foo` is a local variable. ---------------------------------------- Bug #10586: function wrongly returns nil in eval() https://bugs.ruby-lang.org/issues/10586#change-50357 * Author: Daisuke Kobayashi * Status: Rejected * Priority: Normal * Assignee: * Category: * Target version: * ruby -v: ruby 2.0.0p598 (2014-11-13) [x86_64-cygwin] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- In the following code, function returns nil in eval(). Getting rid of the last line, it returns 1 as we expect. ~~~ruby def foo; 1; end p foo #=> 1 eval 'p foo' #=> nil (NG,expect=1) foo=1 #<- bug trigger ~~~ ---Files-------------------------------- code1.rb (244 Bytes) code2.rb (126 Bytes) -- https://bugs.ruby-lang.org/