Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DelegateClass block "method redefined" warning #13

Merged

Conversation

jonathanhefner
Copy link
Contributor

This commit prevents "method redefined" warnings when overriding methods within a DelegateClass block, such as in the following example:

Base = Class.new do
  def foo
    "foo"
  end
end

Overridden = DelegateClass(Base) do
  def foo
    super + "!"
  end
end

Fixes https://bugs.ruby-lang.org/issues/19047.

This commit prevents "method redefined" warnings when overriding methods
within a `DelegateClass` block, such as in the following example:

  ```ruby
  Base = Class.new do
    def foo
      "foo"
    end
  end

  Overridden = DelegateClass(Base) do
    def foo
      super + "!"
    end
  end
  ```

Fixes https://bugs.ruby-lang.org/issues/19047.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants