rescript-lang / rescript-lang/rescript
Proposal: make instatiation of a private record/variant raise a warning instead of an error
Aperta
@tsnobip ci sta già lavorando.
Dal 31/5/2026.
need feedback
- Lingua principale
- OCaml
- Stelle
- 7.5k
- Fork
- 485
- Merge medio
- 1g 2h
- PR unite (30g)
- 55
Descrizione
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)
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Valutazione
Questa issue non è ancora stata valutata.