From: Joseph Jones Date: 2015-12-17T20:45:13-07:00 Subject: [ruby-core:72234] [Ruby trunk - Bug #11836] Optimized methods cannot be overridden after Module#prepend --56738149_327b23c6_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 20:12= :01 MST, shugo=40ruby-lang.org wrote:Issue =2311836 has been updated by S= hugo Maeda.Subject changed from Optimized methods cannot overridden after= Module=23prepend to Optimized methods cannot be overridden after Module=23= prependBackport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN t= o 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: REQUIRED--------------------------= --------------Bug =2311836: Optimized methods cannot be overridden after = Module=23prependhttps://bugs.ruby-lang.org/issues/11836=23change-55642* A= uthor: Shugo Maeda* Status: Closed* Priority: Normal* Assignee: * ruby -v= : * Backport: 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: REQUIRED--------------= --------------------------It seems that optimized methods cannot overridd= en after =60Module=23prepend=60.=60=60=60rubymodule M def /(other) quo(ot= her) endendclass =46ixnum prepend Mendmodule M def %(other) 0 end def foo= puts =22m=23foo=22 endendp 1 / 2 =23=3D> (1/2) overriddenp 1 % 2 =23=3D>= 1 not overridden1.foo =23=3D> m=23foo overridden=60=60=60Is there any go= od way to disable optimization in this case=3F-- https://bugs.ruby-lang.o= rg/ --56738149_327b23c6_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 20:12:01 MST, shugo=40ruby-lang.org wrote:
Issue =2311836 has been upda= ted by Shugo Maeda.

Subject changed from Optimized methods can= not overridden after Module=23prepend to Optimized methods cannot be over= ridden after Module=23prepend
Backport changed from 2.0.0: UNKNOWN, = 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: REQUIR= ED

----------------------------------------
Bug =2311836:= Optimized methods cannot be overridden after Module=23prepend
https= ://bugs.ruby-lang.org/issues/11836=23change-55642

* Author: Sh= ugo Maeda
* Status: Closed
* Priority: Normal
* Assignee: =
* ruby -v:
* Backport: 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: R= EQUIRED
----------------------------------------
It seems that = optimized methods cannot overridden after =60Module=23prepend=60.
=60=60=60ruby
module M
def /(other)
quo(other) end
end
class =46ixnum
prepend M
end
mod= ule M
def %(other)
0
end

def foo
puts =22m=23foo=22
end
end
p 1 / 2 =23=3D> (1/2) o= verridden
p 1 % 2 =23=3D> 1 not overridden
1.foo =23=3D>= m=23foo overridden
=60=60=60

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




--
https://bugs.ruby-lang.org/
--56738149_327b23c6_16c--