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

Unary minus seems broken #6210

Closed
catsidhe opened this issue Mar 18, 2024 · 1 comment
Closed

Unary minus seems broken #6210

catsidhe opened this issue Mar 18, 2024 · 1 comment

Comments

@catsidhe
Copy link

catsidhe commented Mar 18, 2024

Strange unary minus behavior that also prevents overriding it.

> -nil
undefined method '-@' (NoMethodError)
> -nil; nil
 => nil # this doesn't seem OK
> +nil; nil
undefined method '+@' (NoMethodError)
> class Foo; def -@; p 'bar'; end; end; -Foo.new; nil
 => nil # doesn't print "bar" 

e42f192 is the first bad commit

@matz matz closed this as completed in a810b9b Mar 19, 2024
@matz
Copy link
Member

matz commented Mar 19, 2024

Thank you for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants