<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_frozen.rb, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Use actual class instead of singleton class in frozen error message</title>
<updated>2025-12-09T22:35:50+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2025-11-23T03:51:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=76fb0d244b95a23116bfe72bb2422395c3a76477'/>
<id>76fb0d244b95a23116bfe72bb2422395c3a76477</id>
<content type='text'>
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 #&lt;Class:#&lt;Array:0x00000631d1308f78&gt;&gt;: []
```

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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 #&lt;Class:#&lt;Array:0x00000631d1308f78&gt;&gt;: []
```

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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Added tests for setting ivars on frozen objs</title>
<updated>2022-06-16T15:48:08+00:00</updated>
<author>
<name>Jemma Issroff</name>
<email>jemmaissroff@gmail.com</email>
</author>
<published>2022-06-15T19:18:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=51835135a0586f439f581beece13df20100123f0'/>
<id>51835135a0586f439f581beece13df20100123f0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
