-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Improve two errors #7542
Improve two errors #7542
Conversation
Also, it surprises me that |
@bew Only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @r00ster91!
Isn't it misleading that the message says
but |
The error message doesn't specify what kind of variable. It could be for example an instance variable, a class variable or an external variable. It would be misleading if it would say "local variables". |
I agree with @bcardiff . It's misleading because at the syntax level What's wrong with the current error message? |
I don't think there's something wrong with the error. I think at the syntax level |
People usually read "variable" as "local variable". Ask anyone "what's a variable in Ruby" and they will say "the 'x' in 'x = 1'". They will never say "oh, and variable could also mean instance or class variable". I think, if it's not broken, we shouldn't fix it. |
Okay but maybe at least turn |
I vote to close this PR. |
@Sija why? I'm trying to do something out of this PR. |
@r00ster91 because the actual error message is imo good enough. |
This improves the error when you do for example
pointerof(123)
which can be fixed by putting123
in a variable. That's needed because you can't just modify and operate on the raw value123
, that doesn't make sense. The value of a variable however can be modified.And this also makes the stack overflow error slighlty more detailed to make sure there's no confusion. Even after stack overflow detection there was still some confusion about the error: #7032.