Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Constant lookup falls off top scope in new compiler scoping logic #440

Closed
headius opened this Issue · 0 comments

1 participant

@headius
Owner

The top-level scope isn't handled right, so we fall through during lexical search and never get to hierarchical search below.

system ~/projects/jruby $ jruby -X+C -e "module Foo; Symbol = 1; end; class Bar; include Foo; def sym; Symbol; end; end; p Bar.new.sym"
Symbol

system ~/projects/jruby $ jruby -X-C -e "module Foo; Symbol = 1; end; class Bar; include Foo; def sym; Symbol; end; end; p Bar.new.sym"
1
@headius headius closed this issue from a commit
@headius headius Properly set up the toplevel scope under new logic. Fixes #440.
The toplevel scope for a precompiled script was getting set up
with the toplevel scope for the runtime as parent, rather than
no parent. This caused constant lookup to search Object too soon,
at the top of the lexical search. This in turn led to constants
in the hierarchy with names the same as constants in Object to be
inaccessible.
40d9dab
@headius headius closed this in 40d9dab
@martinott martinott referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.