Different type IDs can point at the same type

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

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

評価

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

調査の方向性

まず、typecheck_match() と issue で参照されている型作成の経路を追跡します。2 つの oneof の例を再現し、その後、マッチングが基になる型を比較しているのか、ID を再利用しているのかを判断します。完了条件は、同一の型で型の不一致が発生しなくなることです。

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

説明

bug typechecker

As pointed out in https://github.com/nushell/new-nu-parser/pull/50, typecheck_match() looks only at type IDs without actually checking the underlying type. This means that two identical types, such as:

let x: oneof<list<int>, list<string>> = []
let y: oneof<list<int>, list<string>> = []

would have different IDs and result in type mismatch.

Two possible solutions:

  1. Change typecheck_match() to actually check the types properly
  2. When creating a type, first check whether it's been created already and reuse its ID if so. This would ensure that different type IDs would point at different types.
主要言語
Rust
スター
36
フォーク
11
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートなし
  • コントリビューションガイドを読む

はじめの一歩

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

nushell/new-nu-parser のほかの issue

nushell/new-nu-parser の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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