Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Aug 30, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.3)

Can you help keep this open source service alive? 💖 Please sponsor : )

S-H-GAMELINKS and others added 2 commits August 30, 2025 22:41
Add locations to struct `RNode_SCLASS`.

memo:

```
@ ProgramNode (location: (1,0)-(1,18))
+-- locals: []
+-- statements:
    @ StatementsNode (location: (1,0)-(1,18))
    +-- body: (length: 1)
        +-- @ SingletonClassNode (location: (1,0)-(1,18))
            +-- locals: []
            +-- class_keyword_loc: (1,0)-(1,5) = "class"
            +-- operator_loc: (1,6)-(1,8) = "<<"
            +-- expression:
            |   @ SelfNode (location: (1,9)-(1,13))
            +-- body: nil
            +-- end_keyword_loc: (1,15)-(1,18) = "end"
```
…lone

Previously, you could override the class initialize_dup/initialize_clone
method and the class hierarchy would not be set correctly inside the
method before calling super.

This removes Module#initialize_copy, and instead makes Object#dup/clone
call the underlying C function (rb_mod_init_copy) before calling the
appropriate initialize_dup/initialize_clone method.

This results in the following fixes:

* The appropriate initialize_dup method is called (dup on a class
  will respect superclass initialize_dup).

* Inside class initialize_dup/initialize_clone/initialize_copy,
  class ancestor hierarchy is correct.

* Calling singleton_class inside initialize_dup no longer raises
  a TypeError later in dup.

* Calling singleton_class.ancestors inside initialize_dup no
  longer results in missing ancestors.

Fixes [Bug #21538]
@pull pull bot locked and limited conversation to collaborators Aug 30, 2025
@pull pull bot added the ⤵️ pull label Aug 30, 2025
@pull pull bot merged commit 5c7dfe8 into turkdevops:master Aug 30, 2025
1 of 3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants