Skip to content

Existential types are shown as $Any_'a in errors and hover #9068

Description

@cknitt

Existential type variables of GADT constructors are shown with their internal name $Constructor_'a.

type rec any = Any('a): any

let get = (Any(x)) => x
This has type: $Any_'a
But it's expected to have type: 'a
The type constructor $Any_'a would escape its scope

Hover shows the same name:

type rec any = Any(array<'a>, 'a => string): any
let showAll = (Any(xs, f)) => xs->Array.map(f)
//                 ^ hover: array<$Any_'a>

The message could say that the type is existential, introduced by constructor Any, and that it can't leave the pattern match.

Activity

  1. added theissue type on Oct 27, 2026
  2. added a commit that references this issue on Oct 28, 2026
    bff79a6
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