Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Signature does not compare @as tags of variant cases with payloads

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

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
javascript
領域
compilers

調査の方向性

Start with rule 14 in compiler/ml/UntaggedVariants.md, linked from the issue, and compare its handling of nullary cases with payload cases. Then trace the compiler's interface inclusion checks for variant cases. Done means implementations that change payload case @as tags are rejected, matching the behavior for nullary cases.

索引モデルが issue の本文から書いたものです。

説明

A signature does not compare the @as tags of a variant's cases with payloads. An implementation that swaps the tags passes the signature, and its values match the wrong constructor through the signature.

module M: {
  type t = A({x: int}) | C({x: int})
  let a: t
} = {
  type t = | @as("C") A({x: int}) | @as("A") C({x: int})
  let a = A({x: 1})
}
Console.log(switch M.a { | M.A(_) => "A" | M.C(_) => "C" })

Output: C.

Expected: the implementation is rejected, because its cases' tags differ from the signature's, as they are for nullary cases.

Interface inclusion compares the literals of nullary cases only. The rule is compiler/ml/UntaggedVariants.md rule 14, in #8952.

主要言語
OCaml
スター
7.5k
フォーク
483
平均マージ
21時間 8分
マージ済み PR(30日)
183

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

rescript-lang/rescript のほかの issue

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

似ている issue

Compilers の issue をもっと見る

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

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