Skip to content

Lack of bidirectionality with records #3937

@mtzguido

Description

@mtzguido
noeq
type inj (t1 t2 : Type) = {
  f : t1 -> t2;
}

let double (x:nat) : inj nat nat = {
  f = (fun x -> x+1);
}

This fails with

- Subtyping check failed
- Expected type inj nat nat got type inj int int

The annotation on double should force the right instantiation for the implicits of the record constructor. Note this also fails even if we annotate that x is a nat:

- Subtyping check failed
- Expected type inj nat nat got type inj nat int

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions