diff options
| author | Jeremy Evans <code@jeremyevans.net> | 2025-11-22 19:51:46 -0800 |
|---|---|---|
| committer | Jeremy Evans <code@jeremyevans.net> | 2025-12-10 07:35:50 +0900 |
| commit | 76fb0d244b95a23116bfe72bb2422395c3a76477 (patch) | |
| tree | 3a4c0d1fc7b600b8ca017e8b382829f679fd6a6d /test/ruby/test_encoding.rb | |
| parent | 1e7cf7b2bc1f9b356b2e980e1e18548618da6363 (diff) | |
Use actual class instead of singleton class in frozen error message
With the following code:
```ruby
object = []
object.singleton_class
object.freeze
object.instance_variable_set(:@a, 42)
```
The previous error message was:
```
can't modify frozen #<Class:#<Array:0x00000631d1308f78>>: []
```
With this change, the error message is:
```
can't modify frozen Array: []
```
Since we show the inspect value of the affected object, I think
including the singleton class instead of the actual class if it
exists makes the error message harder to understand.
Diffstat (limited to 'test/ruby/test_encoding.rb')
0 files changed, 0 insertions, 0 deletions
