Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class method const lookup issue #2502

Open
seven1m opened this issue Jan 13, 2025 · 0 comments
Open

Class method const lookup issue #2502

seven1m opened this issue Jan 13, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@seven1m
Copy link
Member

seven1m commented Jan 13, 2025

Another issue to document as I work through #2269 and #2492, but different enough I want to track it separately:

class Foo
  VAL = :a

  class << self
    VAL = :b

    def val1
      VAL
    end
  end

  def self.val2
    VAL
  end
end

p Foo.val1 # => :b
p Foo.val2 # => :a

With Natalie, this produces:

:a
:a
@seven1m seven1m self-assigned this Jan 13, 2025
@seven1m seven1m added the bug Something isn't working label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant