Project

General

Profile

Actions

Feature #18832

closed

Do not have class/module keywords consider ancestors of Object

Added by fxn (Xavier Noria) over 2 years ago. Updated over 2 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:108937]

Description

The following code:

module M
  class C
  end
end

include M

p Object.const_defined?(:C, false)

class C < String # (1)
end

prints false, as expected, but then raises superclass mismatch for class C (TypeError) at (1).

I believe this is a bug, because Object itself does not have a C constant, so (1) should just work, and the superclasse of M::C should be irrelevant.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0