From: Joseph Jones Date: 2015-12-17T21:13:05-07:00 Subject: [ruby-core:72331] [Ruby trunk - Bug #11836] [Open] Optimized methods cannot overridden after Module#prepend --567387d1_7672bd23_16c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Joseph Jones liked your message with Boxer. On December 17, 2015 at 16:16= :28 MST, shugo=40ruby-lang.org wrote:Issue =2311836 has been reported by = Shugo Maeda.----------------------------------------Bug =2311836: Optimiz= ed methods cannot overridden after Module=23prependhttps://bugs.ruby-lang= .org/issues/11836* Author: Shugo Maeda* Status: Open* Priority: Normal* A= ssignee: * ruby -v: * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOW= N----------------------------------------It seems that optimized methods = cannot overridden after =60Module=23prepend=60.=60=60=60rubymodule M def = /(other) quo(other) endendclass =46ixnum prepend Mendmodule M def %(other= ) 0 end def foo puts =22m=23foo=22 endendp 1 / 2 =23=3D> (1/2) overridden= p 1 % 2 =23=3D> 1 not overridden1.foo =23=3D> m=23foo overridden=60=60=60= Is there any good way to disable optimization in this case=3F-- https://b= ugs.ruby-lang.org/ --567387d1_7672bd23_16c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Joseph Jones liked your message with Boxer.


= On December 17, 2015 at 16:16:28 MST, shugo=40ruby-lang.org wrote:
Issue =2311836 has been repo= rted by Shugo Maeda.

----------------------------------------<= br />Bug =2311836: Optimized methods cannot overridden after Module=23pre= pend
https://bugs.ruby-lang.org/issues/11836

* Author: Sh= ugo Maeda
* Status: Open
* Priority: Normal
* Assignee: * ruby -v:
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNO= WN
----------------------------------------
It seems that optim= ized methods cannot overridden after =60Module=23prepend=60.

=60= =60=60ruby
module M
def /(other)
quo(other)
e= nd
end
class =46ixnum
prepend M
end
module M def %(other)
0
end

def foo
pu= ts =22m=23foo=22
end
end
p 1 / 2 =23=3D> (1/2) overridd= en
p 1 % 2 =23=3D> 1 not overridden
1.foo =23=3D> m=23fo= o overridden
=60=60=60

Is there any good way to disable = optimization in this case=3F




--
https:= //bugs.ruby-lang.org/
--567387d1_7672bd23_16c--