[#65451] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...

Issue #10333 has been updated by Koichi Sasada.

9 messages 2014/10/07

[ruby-core:65366] [ruby-trunk - Bug #10280] Regression while evaluating default argments of a method

From: shibata.hiroshi@...
Date: 2014-10-02 06:15:47 UTC
List: ruby-core #65366
Issue #10280 has been updated by Hiroshi SHIBATA.

Related to Bug #10314: Default argument lookup fails in Ruby 2.2 for circular shadowed variable names added

----------------------------------------
Bug #10280: Regression while evaluating default argments of a method
https://bugs.ruby-lang.org/issues/10280#change-49173

* Author: Yuva Kumar
* Status: Rejected
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* ruby -v: ruby 2.2.0preview1 (2014-09-17 trunk 47616) [x86_64-darwin13]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------

~~~ruby
class DefArg
  def calc(str, val=val)
    p val
  end
 
  def val
    10
  end
end
 
# ruby-2.2.0-preview1 => nil
# ruby-2.1.3          => 10
DefArg.new.calc("hello")
~~~

im not sure what ruby spec says. but it looks like this program should print 10 in both the cases.




-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next