Project

General

Profile

Bug #14148

Longstanding behavior regarding correspondence of toplevel with Object is surprising

Added by RickHull (Rick Hull) almost 3 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.0preview1 (2017-10-10 trunk 60153) [x86_64-linux]
[ruby-core:84048]

Description

module Kernel
  X = 1
end

puts String::X

X = 2

puts String::X
$ ruby test.rb
1
Traceback (most recent call last):
test.rb:9:in `<main>': uninitialized constant String::X (NameError)
Did you mean?  X

$ ruby --version
ruby 2.5.0preview1 (2017-10-10 trunk 60153) [x86_64-linux]

Related issues

Related to Ruby master - Feature #11547: remove top-level constant lookupClosedActions

Also available in: Atom PDF