[ruby-core:75837] [Ruby trunk Bug#12458] ::new returns `nil` when first argument is a String '*'

From: s.mackesey@...
Date: 2016-06-04 16:09:06 UTC
List: ruby-core #75837
Issue #12458 has been reported by Sean Mackesey.

----------------------------------------
Bug #12458: ::new returns `nil` when first argument is a String '*'
https://bugs.ruby-lang.org/issues/12458

* Author: Sean Mackesey
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: 
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
I encountered this bug on the 2.4.0-dev branch. It does not exist in 2.3.0.

I have a class with this initialize method:

~~~
  def initialize(str, **kwargs)
    @raw = str
    kwargs.each { |k,v| instance_variable_set("@#{k}", v) }
  end
~~~

When I call ::new with the String '*' as the first argument `str`, it returns `nil` instead of a new instance. I discovered in a class buried deep in my application and was unable to replicate it in a simpler script context.




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

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next