#580 new
Wilson Bilkovich

All core classes should handle setup in allocate, not initialize

Reported by Wilson Bilkovich | May 27th, 2008 @ 03:18 PM | in 1.0 preview

This kind of scenario is common enough in user code that we should assume it will eventually crop up with every core class:

class MyString < String
  # Different initialize signature than String#initialize
  def initialize(foo, baz, zarg = 0)
    super foo
  end
end

This works fine until something comes along and expects the subclass to have the same initialize signature.

This particular one was breaking in String#gsub, trying to create a new "MyString" with self.class.new("something")

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket