[ruby-core:91323] [Ruby trunk Bug#15572] `RubyVM::InstructionSequence` doesn't work with `extend`.

From: samuel@...
Date: 2019-01-29 21:25:08 UTC
List: ruby-core #91323
Issue #15572 has been reported by ioquatix (Samuel Williams).

----------------------------------------
Bug #15572: `RubyVM::InstructionSequence` doesn't work with `extend`.
https://bugs.ruby-lang.org/issues/15572

* Author: ioquatix (Samuel Williams)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
For some reason,`RubyVM::InstructionSequence.extend` doesn't seem to work as expected.

```ruby
module Loader
  def load_iseq(path)
    puts path
    return compile_file(path)
  end
end

# This doesn't work?
# RubyVM::InstructionSequence.extend(Loader)

# This works:
class << RubyVM::InstructionSequence
  prepend Loader
end
```




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

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next