Project

General

Profile

Actions

Bug #11233

closed

Module#include, Module#prepend can accept no arguments

Added by Anonymous almost 9 years ago. Updated almost 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
[ruby-core:69488]

Description

# Module#include, Module#prepend can accept no arguments Module.new.include Module.new.prepend

Updated by jeremyevans0 (Jeremy Evans) almost 9 years ago

This isn't a bug, it a consequence of the fact that they take an arbitrary number of arguments:

Module.new.include(Module.new, Module.new, ...)

Changing it would break code like:

extensions = []
extensions << Module.new if something
extensions << Module.new if something_else
Module.new.include(*extensions)

Updated by Anonymous almost 9 years ago

Jeremy Evans, you are right.

Actions #3

Updated by jeremyevans0 (Jeremy Evans) almost 5 years ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0