Project

General

Profile

Actions

Bug #22612

open

False sharing of prepended singleton methods when singleton class is cloned

Bug #22612: False sharing of prepended singleton methods when singleton class is cloned

Added by alanwu (Alan Wu) about 15 hours ago. Updated about 15 hours ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:127645]

Description

class Foo
  def bar = :from_class
end
mod = Module.new { def bar = [:mod, super] }
o = Foo.new
o.singleton_class.prepend(mod)
clone = o.clone
def     o.bar = :original_only
p clone.bar # => [:mod, :original_only], should be [:mod, :from_class]

def clone.bar = :clone_only
p clone.bar # => :clone_only, should be [:mod, :clone_only]

https://github.com/ruby/ruby/pull/20060

Actions

Also available in: PDF Atom