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] Remove TRUE, FALSE, and NIL constants #2505

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Compatibility:
* `Module#attr_*` methods now return an array of method names (#2498, @gogainda).
* Fixed `Socket#(local|remote)_address` to retrieve family and type from the file descriptor (#2444, @larskanis).
* Add `Thread.ignore_deadlock` accessor (#2453).
* Remove `TRUE`, `FALSE`, and `NIL` constants like CRuby 3.0 (#2505, @andrykonchin).

Performance:

Expand Down
3 changes: 0 additions & 3 deletions spec/tags/language/predefined_tags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,3 @@ slow:The predefined global constant ARGV contains Strings encoded in locale Enco
slow:Global variable $0 is the path given as the main script and the same as __FILE__
slow:Global variable $? is thread-local
slow:Global variable $0 actually sets the program name
fails:The predefined global constants TRUE is no longer defined
fails:The predefined global constants FALSE is no longer defined
fails:The predefined global constants NIL is no longer defined
3 changes: 0 additions & 3 deletions src/main/ruby/truffleruby/core/false.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,3 @@ def self.__allocate__
raise TypeError, "allocator undefined for #{self}"
end
end

FALSE = false
Object.deprecate_constant :FALSE
3 changes: 0 additions & 3 deletions src/main/ruby/truffleruby/core/nil.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,3 @@ def self.__allocate__
raise TypeError, "allocator undefined for #{self}"
end
end

NIL = nil
Object.deprecate_constant :NIL
3 changes: 0 additions & 3 deletions src/main/ruby/truffleruby/core/true.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,3 @@ def self.__allocate__
raise TypeError, "allocator undefined for #{self}"
end
end

TRUE = true
Object.deprecate_constant :TRUE