Project

General

Profile

Actions

Bug #19167

closed

Object#inspect does not correctly show NilClass TrueClass and FalseClass stored in instance variables

Added by tompng (tomoya ishida) about 2 years ago. Updated about 2 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin20]
[ruby-core:111135]

Description

Object.new.instance_eval do
  @a = nil
  @b = NilClass
  @c = true
  @d = TrueClass
  @e = [nil, NilClass, true, TrueClass]
  puts self.inspect
end
# actual
# => #<Object:0x2f15e3c8 @a=nil, @b=nil, @c=true, @d=true, @e=[nil, NilClass, true, TrueClass]>
# expected
# => #<Object:0x2f15e3c8 @a=nil, @b=NilClass, @c=true, @d=TrueClass, @e=[nil, NilClass, true, TrueClass]>

Files

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like1Like0