Skip to content

alias_method inside refine causes `alias_method': undefined method for module #1942

@deepj

Description

@deepj

To reproduce:

module SnakeCase
  refine ::String do
    def snake_case
    end

    alias_method :snakecase, :snake_case
  end
end

Error:

ref.rb:6:in `alias_method': undefined method `snake_case' for module `#<Module:0x200>' (NameError)
	from ref.rb:6:in `block in SnakeCase'
	from ref.rb:2:in `refine'
	from ref.rb:2:in `SnakeCase'
	from ref.rb:1:in `<main>'

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions