Commit 191bfcb
committed
Define Kernel#instance_variables_to_inspect
[Bug #21718]
Otherwise objects that don't define it, but define a fairly liberal
`method_missing` method will run into errors that are hard to understand:
```ruby
class Foo
def method_missing(name, ...)
name
end
end
p Foo.new.inspect
```
```
'Kernel#inspect': wrong argument type Symbol (expected Array) (TypeError)
from ../test.rb:7:in '<main>'
```1 parent 8eaefd9 commit 191bfcb
2 files changed
+47
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
854 | 854 | | |
855 | 855 | | |
856 | 856 | | |
857 | | - | |
| 857 | + | |
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
861 | | - | |
862 | | - | |
| 861 | + | |
863 | 862 | | |
864 | 863 | | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
865 | 872 | | |
866 | 873 | | |
867 | 874 | | |
| |||
875 | 882 | | |
876 | 883 | | |
877 | 884 | | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
878 | 892 | | |
879 | 893 | | |
880 | 894 | | |
| |||
4535 | 4549 | | |
4536 | 4550 | | |
4537 | 4551 | | |
| 4552 | + | |
4538 | 4553 | | |
4539 | 4554 | | |
4540 | 4555 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
60 | 89 | | |
61 | 90 | | |
0 commit comments