Proposal: make instatiation of a private record/variant raise a warning instead of an error
@tsnobip 已經在處理了。
開始於 2026年5月31日。
評估
這個 Issue 還沒有評估資料。
描述
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)
- 主要語言
- OCaml
- 星號
- 7.5k
- 分支
- 485
- 平均合併
- 1 天 2 小時
- 30 天內合併 PR
- 55
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
rescript-lang/rescript 的其他 Issue
-
難度 5/5 一週以上 新手友好度 35/100
rescript-lang/rescript#8659 · 2 則留言 · 2 個 reaction ·
-
難度 5/5 一週以上 新手友好度 35/100
rescript-lang/rescript#8647 ·
-
rescript-lang/rescript#8632 · 已指派 1 人 ·
-
難度 5/5 一週以上 新手友好度 28/100
rescript-lang/rescript#8624 ·
-
難度 5/5 一週以上 新手友好度 30/100
rescript-lang/rescript#8596 · 2 則留言 ·