Proposal: make instatiation of a private record/variant raise a warning instead of an error
@tsnobip ci sta già lavorando.
Dal 31/5/2026.
Valutazione
Questa issue non è ancora stata valutata.
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)
- Lingua principale
- OCaml
- Stelle
- 7.5k
- Fork
- 485
- Merge medio
- 1g 2h
- PR unite (30g)
- 55
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.
Altre issue di rescript-lang/rescript
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
rescript-lang/rescript#8659 · 2 commenti · 2 reazioni ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
rescript-lang/rescript#8647 ·
-
rescript-lang/rescript#8632 · 1 assegnatario ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 28/100
rescript-lang/rescript#8624 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
rescript-lang/rescript#8596 · 2 commenti ·