Skip to content

Proposal: make instatiation of a private record/variant raise a warning instead of an error #8458

Description

@tsnobip

Today, when you try to create a private record or variant, it errors:

module Foo = {
  type t = private {foo: int}
}

let bar = {Foo.foo: 9} // Error: Cannot create values of the private type Foo.t

Though, there are cases where you'd want to force the instantiation for example for testing, moving this from an error to a warning would allow this. We could use the same warning when casting to a private record/variant (cf #8457)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions