Shopify / Shopify/rubydex

Resolution logic should take the location into account

Open
#491 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
355
Forks
24
Avg merge
2d 6h
Merged PRs (30d)
17

Description

Let's take this example:

module Foo; end

module Bar
  puts Foo

  module Foo
    FOO = 42
  end
end

Because we always resolve definitions before constant references, puts Foo will point to ::Bar::Foo instead of ::Foo.

We should consider the reference location and note that as we resolve puts Foo, the module Bar::Foo hasn't been defined yet.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the resolution logic for constant references and how it orders definitions relative to references. Reproduce the Ruby example from the issue, then verify that puts Foo resolves to ::Foo when Bar::Foo is defined later; the change is done when resolution accounts for the reference location.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby, rust
Domain
compilers, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.