Skip to content

Verbose type-enclosing queries not working on record fields #1564

@ddickstein

Description

@ddickstein

I'm having some trouble with verbose type-enclosing queries on record fields. Consider the following example:

module Kind = struct
  type t =
    | A
    | B
end

type t = { kind : Kind.t }

let x = { kind = A }
let y = x.kind
let z = { kind = B }.kind

If you do a verbose type-enclosing query on y, you will see type t = A | B. You also get this for z and for the kind field in { kind = B }.kind. However, for the kind in x.kind, increasing the verbosity continues to return Kind.t. This behavior is unfortunate as it can lead people to assume the type is abstract.

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