Issue #11836 has been updated by Shugo Maeda.

Subject changed from Optimized methods cannot overridden after Module#prepend to Optimized methods cannot be overridden after Module#prepend
Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: REQUIRED

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

* Author: 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 overridden after `Module#prepend`.

```ruby
module M
  def /(other)
    quo(other)
  end
end
class Fixnum
  prepend M
end
module M
  def %(other)
    0
  end

  def foo
    puts "m#foo"
  end
end
p 1 / 2 #=> (1/2)  overridden
p 1 % 2 #=> 1      not overridden
1.foo   #=> m#foo  overridden
```

Is there any good way to disable optimization in this case?




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