Proposal: make instatiation of a private record/variant raise a warning instead of an error
@tsnobip arbeitet bereits daran.
Seit 31.5.2026.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
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)
- Vorherrschende Sprache
- OCaml
- Sterne
- 7.5k
- Forks
- 485
- Ø Merge
- 1 T. 2 Std.
- Gemergte PRs (30 T.)
- 55
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus rescript-lang/rescript
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
rescript-lang/rescript#8659 · 2 Kommentare · 2 Reaktionen ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
rescript-lang/rescript#8647 ·
-
rescript-lang/rescript#8632 · 1 zugewiesene Person ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 28/100
rescript-lang/rescript#8624 ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 30/100
rescript-lang/rescript#8596 · 2 Kommentare ·