Skip to content

Completion fails on inlined record field #1977

@trefis

Description

@trefis
$ cat inlined_record.ml
type t = Constr of { some_lbl: int }

let foo (x : t) =
  match x with
  | Constr { som }

❯ ocamlmerlin single complete-prefix -position 5:16 -prefix 'some' -filename inlined_record.ml < ./inlined_record.ml | jq .value
{
  "entries": [],
  "context": null
}

❯ cat indirect.ml
type r = { some_lbl: int }
type t = Constr of r

let foo (x : t) =
  match x with
  | Constr { som }

❯ ocamlmerlin single complete-prefix -position 6:16 -prefix 'some' -filename indirect.ml < ./indirect.ml | jq .value
{
  "entries": [
    {
      "name": "some_lbl",
      "kind": "Label",
      "desc": "r -> int",
      "info": "",
      "deprecated": false
    }
  ],
  "context": null
}

There's not much in the log:

  • # 0.01 Completion - fold_sumtype_constructors
    node type: t.Constr
    
    for the first case
  • # 0.01 Completion - fold_sumtype_constructors
    node type: r
    
    for the second

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