<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_refinement.rb, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) 1e7cf7b2bc1f9b356b2e980e1e18548618da6363: [Backport #21446]</title>
<updated>2025-12-16T23:51:44+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-12-16T23:51:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7edff469e14541a480a6156efc1cc6e3b526e7bd'/>
<id>7edff469e14541a480a6156efc1cc6e3b526e7bd</id>
<content type='text'>
	[PATCH] Fix refinement modification of method visibility in superclass

	Previously, this didn't work correctly, resulting in a
	SystemStackError. This fixes the issue by finding the related
	superclass method entry, and updating the orig_me in the
	refinement method to point to the superclass method.

	Fixes [Bug #21446]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[PATCH] Fix refinement modification of method visibility in superclass

	Previously, this didn't work correctly, resulting in a
	SystemStackError. This fixes the issue by finding the related
	superclass method entry, and updating the orig_me in the
	refinement method to point to the superclass method.

	Fixes [Bug #21446]
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) a4dff09be79b52288a47658964d25e5aa84fc960: [Backport #21265]</title>
<updated>2025-12-08T22:38:24+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-12-08T22:38:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=625eeae0db2749e62152d8a750706eff24a271d0'/>
<id>625eeae0db2749e62152d8a750706eff24a271d0</id>
<content type='text'>
	[PATCH] [Bug #21673] Fix resolving refined module-defined method

	A method defined in a module has no `defined_class`, use the ICLASS
	for it as the `defined_class`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[PATCH] [Bug #21673] Fix resolving refined module-defined method

	A method defined in a module has no `defined_class`, use the ICLASS
	for it as the `defined_class`.
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 6e6f5d3c32a709c891ac6aa7833376907a6c81b5: [Backport #21265]</title>
<updated>2025-12-08T22:21:06+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-12-08T22:21:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ef2d4bf51bf28cfc427388a19e4a5fe9bbbe7a7a'/>
<id>ef2d4bf51bf28cfc427388a19e4a5fe9bbbe7a7a</id>
<content type='text'>
	[PATCH] Add test for [Bug #21265]

	The crash was fixed by a4dff09be79b52288a47658964d25e5aa84fc960 ("Fix
	resolving refined module-defined method"). I had a patch for this around
	for a few months but never merged it. Oops!
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[PATCH] Add test for [Bug #21265]

	The crash was fixed by a4dff09be79b52288a47658964d25e5aa84fc960 ("Fix
	resolving refined module-defined method"). I had a patch for this around
	for a few months but never merged it. Oops!
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove deprecated method Refinement#refined_class</title>
<updated>2024-11-19T05:33:38+00:00</updated>
<author>
<name>Shugo Maeda</name>
<email>shugo@ruby-lang.org</email>
</author>
<published>2024-11-19T04:41:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7ed027a8332e6f64b2a3253f3b48c0488f1184aa'/>
<id>7ed027a8332e6f64b2a3253f3b48c0488f1184aa</id>
<content type='text'>
[Feature #20901]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Feature #20901]
</pre>
</div>
</content>
</entry>
<entry>
<title>Stop using the "undef" keyword to remove a constant</title>
<updated>2024-08-29T17:54:55+00:00</updated>
<author>
<name>Alan Wu</name>
<email>alanwu@ruby-lang.org</email>
</author>
<published>2024-08-29T17:54:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e07f794967abfca691a275ebdbf0bfc2268a6057'/>
<id>e07f794967abfca691a275ebdbf0bfc2268a6057</id>
<content type='text'>
The keyword tries to remove a method of the same name which is unlikely
to be the intention of this test:

    $ ruby -e 'undef Object'
    -e:1:in '&lt;main&gt;': undefined method 'Object' for class 'Object' (NameError)

Found looking at GH-11497. The NameError triggers error_highlight, which
loads a bunch of file under GC.stress set by this test when using Prism.
That takes a long time, causing a timeout.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The keyword tries to remove a method of the same name which is unlikely
to be the intention of this test:

    $ ruby -e 'undef Object'
    -e:1:in '&lt;main&gt;': undefined method 'Object' for class 'Object' (NameError)

Found looking at GH-11497. The NameError triggers error_highlight, which
loads a bunch of file under GC.stress set by this test when using Prism.
That takes a long time, causing a timeout.
</pre>
</div>
</content>
</entry>
<entry>
<title>Ensure test suite is compatible with --frozen-string-literal</title>
<updated>2024-03-14T16:56:15+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>byroot@ruby-lang.org</email>
</author>
<published>2024-03-13T11:50:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=09d8c99cdcb04fb6c6c8e61c9dea28927a3a0b46'/>
<id>09d8c99cdcb04fb6c6c8e61c9dea28927a3a0b46</id>
<content type='text'>
As preparation for https://bugs.ruby-lang.org/issues/20205
making sure the test suite is compatible with frozen string
literals is making things easier.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As preparation for https://bugs.ruby-lang.org/issues/20205
making sure the test suite is compatible with frozen string
literals is making things easier.
</pre>
</div>
</content>
</entry>
<entry>
<title>Clear all refined CCs on reopening refinement mod</title>
<updated>2024-03-07T18:06:48+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2024-02-20T02:53:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=18ee7c9a108bf3424814565377c8796e5e455cf7'/>
<id>18ee7c9a108bf3424814565377c8796e5e455cf7</id>
<content type='text'>
In cfd7729ce7a31c8b6ec5dd0e99c67b2932de4732 we started using inline
caches for refinements. However, we weren't clearing inline caches when
defined on a reopened refinement module.

Fixes [Bug #20246]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In cfd7729ce7a31c8b6ec5dd0e99c67b2932de4732 we started using inline
caches for refinements. However, we weren't clearing inline caches when
defined on a reopened refinement module.

Fixes [Bug #20246]
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #20302] Multiple refinements cannot be applied to the same module</title>
<updated>2024-02-27T05:51:04+00:00</updated>
<author>
<name>Shugo Maeda</name>
<email>shugo@ruby-lang.org</email>
</author>
<published>2024-02-27T05:19:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d50f9ca2dd416d92152cd958b5f39496088481b0'/>
<id>d50f9ca2dd416d92152cd958b5f39496088481b0</id>
<content type='text'>
In the following code, the iclass tree of refinements in cref should be &lt;iclass of Kernel@M2&gt; -&gt; &lt;iclass of Kernel@M1&gt; -&gt; Kernel.

However, the iclass tree was broken because of code for included modules of refinements in rb_using_refinement().
Refinement#include is now removed, so this commit removes such unnecessary code.

```ruby
module M1
  refine(Kernel) do
    def f1 = :f1
  end
end

module M2
  refine(Kernel) do
    def f2 = :f2
  end
end

class Foo
  using M1
  using M2

  def test
    p f2 #=&gt; :f2

    p f1 # expected =&gt; :f1
         # actual =&gt; undefined local variable or method 'f1' for an instance of Foo
  end
end

Foo.new.test
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the following code, the iclass tree of refinements in cref should be &lt;iclass of Kernel@M2&gt; -&gt; &lt;iclass of Kernel@M1&gt; -&gt; Kernel.

However, the iclass tree was broken because of code for included modules of refinements in rb_using_refinement().
Refinement#include is now removed, so this commit removes such unnecessary code.

```ruby
module M1
  refine(Kernel) do
    def f1 = :f1
  end
end

module M2
  refine(Kernel) do
    def f2 = :f2
  end
end

class Foo
  using M1
  using M2

  def test
    p f2 #=&gt; :f2

    p f1 # expected =&gt; :f1
         # actual =&gt; undefined local variable or method 'f1' for an instance of Foo
  end
end

Foo.new.test
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix cache incoherency for ME resolved through VM_METHOD_TYPE_REFINED</title>
<updated>2023-11-28T18:03:04+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2023-11-28T00:19:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cd4207869ff831c41db3ec873b175369ffca080a'/>
<id>cd4207869ff831c41db3ec873b175369ffca080a</id>
<content type='text'>
Previously, we didn't invalidate the method entry wrapped by
VM_METHOD_TYPE_REFINED method entries which could cause calls to
land in the wrong method like it did in the included test.

Do the invalidation, and adjust rb_method_entry_clone() to accommodate
this new invalidation vector.

Fix: cfd7729ce7a31c8b6ec5dd0e99c67b2932de4732
See-also: e201b81f79828c30500947fe8c8ea3c515e3d112
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, we didn't invalidate the method entry wrapped by
VM_METHOD_TYPE_REFINED method entries which could cause calls to
land in the wrong method like it did in the included test.

Do the invalidation, and adjust rb_method_entry_clone() to accommodate
this new invalidation vector.

Fix: cfd7729ce7a31c8b6ec5dd0e99c67b2932de4732
See-also: e201b81f79828c30500947fe8c8ea3c515e3d112
</pre>
</div>
</content>
</entry>
<entry>
<title>Supress warnings by Refinement#refined_class in test code</title>
<updated>2023-08-01T00:48:47+00:00</updated>
<author>
<name>Shugo Maeda</name>
<email>shugo@ruby-lang.org</email>
</author>
<published>2023-08-01T00:48:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0b8045c9c9b9f9c3e22e38f7d77b273efb2db2b0'/>
<id>0b8045c9c9b9f9c3e22e38f7d77b273efb2db2b0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
