Skip to content

Find References misses uses written through another module path #9321

In review

Description

@cknitt

Find References misses uses in other files when they are written through a different module path than the declaration's.

// Fn.res
module type Ord = {
  type t
}
module IntOrd = {
  type t = int
}
module MakeSet = (O: Ord) => {
  let add = (x: O.t) => [x]
}
module MakeTwo = (A: Ord, B: Ord) => {
  let pair = 1
}
module First = MakeTwo(IntOrd)

// Use.res
module S = Fn.MakeSet(Fn.IntOrd)
let s = S.add(1)
module Make = Fn.MakeSet
module Aliased = Make(Fn.IntOrd)
let a = Aliased.add(1)
module Fin = Fn.First(Fn.IntOrd)
let p = Fin.pair

// Far.res
let f = Use.S.add(2)
Find References on Finds Misses
add in Fn.res the declaration, S.add Aliased.add, Use.S.add in Far.res
pair in Fn.res the declaration Fin.pair
Use.S.add in Far.res the declaration, S.add the use in Far.res itself, Aliased.add

A use in another file is recorded under the path it is written with (Aliased.add, Use.S.add, Fin.pair). Find References searches other files only under the declaration's own path (Fn.MakeSet.add), so uses through an alias of the functor, through the file that applies it, or through a partial application are not found. Rename then leaves them unchanged and the code no longer compiles.

Plain values of a namespaced dependency show the same problem: for a dependency with namespace Dep, uses of Dep.Utils.Plain.plain are recorded under Dep but searched under Utils-Dep, so Find References on plain finds only its declaration.

Found while reviewing #9084.

Activity

  1. added theissue type on Nov 18, 2026
  2. added 7 commits that reference this issue on Nov 19, 2026
    464c187
    0d4b271
    4f7a8e1
    3263625
    a9d05e5
    6dfad2a
    b14c9d4
  3. added 3 commits that reference this issue on Nov 30, 2026
    068e9c8
    c0d0f9d
    0b6ebf7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions