<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_class.rb, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[Bug #19833] Fix index underflow at superclasses of `BasicObject`</title>
<updated>2023-08-08T10:03:38+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-08-08T10:03:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=72d1a790cfe0e4a457db98c587f1acaa5e39f001'/>
<id>72d1a790cfe0e4a457db98c587f1acaa5e39f001</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Prevent warning: assigned but unused variable</title>
<updated>2023-05-10T14:49:44+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2023-05-10T14:49:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a19fa9b2bd94097e973fbdca48722c80b4d9b19f'/>
<id>a19fa9b2bd94097e973fbdca48722c80b4d9b19f</id>
<content type='text'>
http://rubyci.s3.amazonaws.com/debian10/ruby-master/log/20230510T123003Z.log.html.gz
```
/home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/objspace/test_objspace.rb:224: warning: assigned but unused variable - c4
/home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/ruby/test_class.rb:362: warning: assigned but unused variable - e
/home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/ruby/test_process.rb:2602: warning: assigned but unused variable - parent_pid
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
http://rubyci.s3.amazonaws.com/debian10/ruby-master/log/20230510T123003Z.log.html.gz
```
/home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/objspace/test_objspace.rb:224: warning: assigned but unused variable - c4
/home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/ruby/test_class.rb:362: warning: assigned but unused variable - e
/home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/ruby/test_process.rb:2602: warning: assigned but unused variable - parent_pid
```
</pre>
</div>
</content>
</entry>
<entry>
<title>fix `NameError` message</title>
<updated>2023-04-19T05:53:56+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2023-04-19T02:40:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=628e432739e1d2578d357420aa652a97eb8c2649'/>
<id>628e432739e1d2578d357420aa652a97eb8c2649</id>
<content type='text'>
The following code produces two NameErrors respectively
and they are independent, but the second one can show
`private constant` message because of first NameError.

```ruby
class C
  class PrivateClass; end
  private_constant :PrivateClass
end

begin
  eval('class C::PrivateClass; end')
rescue =&gt; e
  p e
end

begin
  Object.const_get 'Foo'
rescue =&gt; e
  p e
end

  #&lt;NameError: private constant C::PrivateClass referenced&gt;
  #&lt;NameError: private constant C::Foo referenced&gt;
  #=&gt; should be #&lt;NameError: uninitialized constant Foo&gt;
```

It fails the test-all tests with
`make test-all TESTS='ruby/class ruby/parse --seed=58891 -v`.

The reason is clear miss from https://github.com/ruby/ruby/commit/7387c08373a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The following code produces two NameErrors respectively
and they are independent, but the second one can show
`private constant` message because of first NameError.

```ruby
class C
  class PrivateClass; end
  private_constant :PrivateClass
end

begin
  eval('class C::PrivateClass; end')
rescue =&gt; e
  p e
end

begin
  Object.const_get 'Foo'
rescue =&gt; e
  p e
end

  #&lt;NameError: private constant C::PrivateClass referenced&gt;
  #&lt;NameError: private constant C::Foo referenced&gt;
  #=&gt; should be #&lt;NameError: uninitialized constant Foo&gt;
```

It fails the test-all tests with
`make test-all TESTS='ruby/class ruby/parse --seed=58891 -v`.

The reason is clear miss from https://github.com/ruby/ruby/commit/7387c08373a
</pre>
</div>
</content>
</entry>
<entry>
<title>Module#remove_method: Check frozen on the right object</title>
<updated>2022-12-01T22:32:41+00:00</updated>
<author>
<name>Jean byroot Boussier</name>
<email>jean.boussier+github@shopify.com</email>
</author>
<published>2022-12-01T22:32:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3d272b0fc822f5c2e9c716377b7fcecf15426b27'/>
<id>3d272b0fc822f5c2e9c716377b7fcecf15426b27</id>
<content type='text'>
Previously, the frozen check happened on `RCLASS_ORIGIN(self)`, which
can return an iclass. The frozen check is supposed to respond to objects
that users can call methods on while iclasses are hidden from users.
Other mutation methods like Module#{define_method,alias_method,public}
don't do this. Check frozen status on the module itself.

Fixes [Bug #19164] and [Bug #19166].

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, the frozen check happened on `RCLASS_ORIGIN(self)`, which
can return an iclass. The frozen check is supposed to respond to objects
that users can call methods on while iclasses are hidden from users.
Other mutation methods like Module#{define_method,alias_method,public}
don't do this. Check frozen status on the module itself.

Fixes [Bug #19164] and [Bug #19166].

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Add Class#attached_object</title>
<updated>2022-10-20T15:30:17+00:00</updated>
<author>
<name>Ufuk Kayserilioglu</name>
<email>ufuk@paralaus.com</email>
</author>
<published>2022-09-26T22:19:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0378e2f4a8319440dd65c82b16f189161472d237'/>
<id>0378e2f4a8319440dd65c82b16f189161472d237</id>
<content type='text'>
Implements [Feature #12084]

Returns the object for which the receiver is the singleton class, or
raises TypeError if the receiver is not a singleton class.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implements [Feature #12084]

Returns the object for which the receiver is the singleton class, or
raises TypeError if the receiver is not a singleton class.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove Class#descendants</title>
<updated>2021-12-20T19:02:15+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2021-12-20T16:26:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3bd5f27f737c7d365b7d01c43d77a958c224ab16'/>
<id>3bd5f27f737c7d365b7d01c43d77a958c224ab16</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>TestClass#test_subclass_gc reduce the number of iteration by 10x</title>
<updated>2021-12-03T11:27:29+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2021-12-03T09:17:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=324d57df0b28982590609d7ae080f82074a82a5c'/>
<id>324d57df0b28982590609d7ae080f82074a82a5c</id>
<content type='text'>
The test was taking 10 seconds on my machine and did timeout
on CI once.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The test was taking 10 seconds on my machine and did timeout
on CI once.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add Class#subclasses</title>
<updated>2021-11-23T09:50:44+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2021-10-28T12:07:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c0c2b31a35e19a47b499b57807bc0a0f9325f6d3'/>
<id>c0c2b31a35e19a47b499b57807bc0a0f9325f6d3</id>
<content type='text'>
Implements [Feature #18273]

Returns an array containing the receiver's direct subclasses without
singleton classes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implements [Feature #18273]

Returns an array containing the receiver's direct subclasses without
singleton classes.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix a memory leak introduced in 8bbd319</title>
<updated>2021-11-11T13:54:48+00:00</updated>
<author>
<name>Matt Valentine-House</name>
<email>matt@eightbitraptor.com</email>
</author>
<published>2021-11-10T22:42:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c53aecee3bec524b91d7f2534291802a1cabb3f5'/>
<id>c53aecee3bec524b91d7f2534291802a1cabb3f5</id>
<content type='text'>
This commit fixes a memory leak introduced in an early part of the
variable width allocation project that would prevent the rb_classext_t
struct from being free'd when the class is swept.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit fixes a memory leak introduced in an early part of the
variable width allocation project that would prevent the rb_classext_t
struct from being free'd when the class is swept.
</pre>
</div>
</content>
</entry>
<entry>
<title>class.c: descendants must not cause GC until the result array is created</title>
<updated>2021-11-10T01:08:30+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2021-11-09T08:06:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5c892da7d7974aeed8e7dd97bb31d2394cc19356'/>
<id>5c892da7d7974aeed8e7dd97bb31d2394cc19356</id>
<content type='text'>
Follow up of 428227472fc6563046d8138aab17f07bef6af753. The previous fix
uses `rb_ary_new_from_values` to create the result array, but it may
trigger the GC.

This second try is to create the result array by `rb_ary_new_capa`
before the second iteration, and assume that `rb_ary_push` does not
trigger GC. This assumption is very fragile, so should be improved in
future.

[Bug #18282] [Feature #14394]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow up of 428227472fc6563046d8138aab17f07bef6af753. The previous fix
uses `rb_ary_new_from_values` to create the result array, but it may
trigger the GC.

This second try is to create the result array by `rb_ary_new_capa`
before the second iteration, and assume that `rb_ary_push` does not
trigger GC. This assumption is very fragile, so should be improved in
future.

[Bug #18282] [Feature #14394]
</pre>
</div>
</content>
</entry>
</feed>
