Project

General

Profile

Actions

Bug #12458

closed

::new returns `nil` when first argument is a String '*'

Bug #12458: ::new returns `nil` when first argument is a String '*'

Added by s.mackesey (Sean Mackesey) over 9 years ago. Updated over 9 years ago.

Status:
Third Party's Issue
Assignee:
-
Target version:
-
[ruby-core:75837]

Description

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.

Updated by s.mackesey (Sean Mackesey) over 9 years ago Actions #1 [ruby-core:75838]

Sorry, looks like this is actually due to bug in rspec-mocks rather than Ruby itself, so I think this can be closed.

Updated by nobu (Nobuyoshi Nakada) over 9 years ago Actions #2 [ruby-core:75840]

  • Description updated (diff)
  • Status changed from Open to Third Party's Issue
Actions

Also available in: PDF Atom