Project

General

Profile

Actions

Bug #14853

closed

[BACKPORT] NameError#receiver at private constant returns a hidden object

Added by nobu (Nobuyoshi Nakada) almost 6 years ago. Updated over 5 years ago.

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

Description

Fixed by r63696.

module M
  X = 1
  private_constant :X
end
begin
  Module.new{include M}::X
rescue NameError => e
  e.receiver.object_id # undefined method `object_id' for #<M:0x000000010c5f7e88> (NoMethodError)
end

This is an ICLASS object which must not appear in the ruby level.

Updated by nagachika (Tomoyuki Chikanaga) almost 6 years ago

  • Backport changed from 2.3: REQUIRED, 2.4: REQUIRED, 2.5: REQUIRED to 2.3: REQUIRED, 2.4: REQUIRED, 2.5: DONE

ruby_2_5 r63825 merged revision(s) 63696.

Updated by usa (Usaku NAKAMURA) over 5 years ago

  • Backport changed from 2.3: REQUIRED, 2.4: REQUIRED, 2.5: DONE to 2.3: REQUIRED, 2.4: DONE, 2.5: DONE

ruby_2_4 r64559 merged revision(s) 63696.

Actions

Also available in: Atom PDF

Like0
Like0Like0