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

Consolidate redefined the method warning #10581

Merged
merged 1 commit into from Apr 23, 2024

Conversation

casperisfine
Copy link
Contributor

Currently redefining a method doesn't emit one but two warnings. One at the location of the new method, and one at the location of the old method.

I believe this is not ideal because when collecting warnings via a custom Warning.warn, it has to be pieced together. It's even more tricky because the second part may or may not be emitted depending on whether the original method has an associated ISeq.

I think it's much better to emit a single warning with all the information in one go.

This comment has been minimized.

@casperisfine casperisfine force-pushed the unify-redefined-method-warning branch from b4f797b to 857aaa4 Compare April 19, 2024 13:21
vm_method.c Outdated Show resolved Hide resolved
Currently redefining a method doesn't emit one but two warnings.
One at the location of the new method, and one at the location of
the old method.

I believe this is not ideal because when collecting warnings via
a custom `Warning.warn`, it has to be pieced together. It's even
more tricky because the second part may or may not be emitted
depending on whether the original method has an associated ISeq.

I think it's much better to emit a single warning with all the
information in one go.
@casperisfine casperisfine force-pushed the unify-redefined-method-warning branch from 857aaa4 to ee78c11 Compare April 19, 2024 15:12
@casperisfine casperisfine requested a review from nobu April 19, 2024 15:12
@byroot byroot changed the title Consolitate redefined the method warning Consolidate redefined the method warning Apr 22, 2024
@byroot byroot merged commit fff2284 into ruby:master Apr 23, 2024
100 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants