Skip to content

Merlin reports incorrect module type (confused with module signature) #1607

@ddickstein

Description

@ddickstein

Tested on 9fc6355

module type Empty = sig end

module Foo = struct
  module type S = Empty

  let x = ()
end

module type Foo = Foo.S

module S : sig
  val f : (module Foo) -> unit
end = struct
  let f (module M : Foo) = ignore M.x
end

This of course does not work - M.x is not available. However, if you try to get the type of Foo on either the val f or let f line, you will see a signature with x, suggesting that it should be available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions