Skip to content

Reverse aliasing warns when it should not #9450

Description

@headius

A form of reverse aliasing (returning a method name back to its original target method after previously aliasing it) found in Rails 8.0's redefine_method.rb produces warnings when apparently it should not.

/Users/headius/work/rails/activesupport/lib/active_support/testing/time_helpers.rb:62: warning: method redefined; discarding old new
/Users/headius/work/rails/activesupport/lib/active_support/testing/time_helpers.rb:181: warning: previous definition of new was here
/Users/headius/work/rails/activesupport/lib/active_support/testing/time_helpers.rb:62: warning: method redefined; discarding old today
/Users/headius/work/rails/activesupport/lib/active_support/testing/time_helpers.rb:190: warning: previous definition of today was here
/Users/headius/work/rails/activesupport/lib/active_support/testing/time_helpers.rb:62: warning: method redefined; discarding old now

This seems to have something to do with a hack from rails/rails#29233 that re-aliases the same alias so it can go back without a warning. However this does not appear to work properly in JRuby.

I attempted to fix this in #9447 but it has not yet solved the issue.

Can be reproduced by running the Rails ActiveRecord suite for ARJDBC as described in #9449.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions