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

オープン
#8,458 コメント 2 件 リアクション 2 件 担当者 1 名 GitHub で見る

@tsnobip がすでに取り組んでいます。

2026年5月31日 から。

評価

この issue はまだ評価されていません。

説明

need feedback

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時間
マージ済み PR(30日)
55

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rescript-lang/rescript のほかの issue

rescript-lang/rescript の issue をすべて見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。