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

[Ruby 3.0 support] Don't warn when uninitialized instance variable is accessed #2502

Conversation

andrykonchin
Copy link
Member

@andrykonchin andrykonchin commented Oct 15, 2021

The PR fixes the following item:

[easy, cleanup] Accessing an uninitialized instance variable no longer emits a
warning in verbose mode. [Feature #17055]

Related issue - #2453

Changes:

  • removed the warning emitting
  • removed a comment that mentioned this behavior

@eregon
Copy link
Member

eregon commented Oct 15, 2021

I haven't added any unit test in the RubySpec suite because it IMHO doesn't make sense to test absence of a feature. I tested it manually:

I hate to disagree but I think we should add one (unless there is already one).
The reason is then ruby/spec specifically tests that in Ruby 3+ it's OK to use uninitialized ivars, it won't warn (or it's a Ruby impl bug), and also this makes it easier for other Ruby implementations to notice the change.

@eregon eregon self-assigned this Oct 18, 2021
Copy link
Member

@eregon eregon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@eregon eregon added the in-ci The PR is being tested in CI. Do not push new commits. label Oct 18, 2021
@eregon eregon force-pushed the ruby-3-0-support-accessing-uninitialized-instance-variable branch from bd5f2b0 to 6833ee9 Compare October 21, 2021 13:09
@eregon eregon added this to the 22.0.0 milestone Oct 21, 2021
@graalvmbot graalvmbot merged commit 90b9226 into oracle:master Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in-ci The PR is being tested in CI. Do not push new commits. oca-signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants