[TS] Support field assignments that change the runtime value sort
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- kotlin, typescript
調査の方向性
Start with the unsupported path reported by PR #466 and the related context in issue #465, using the minimal TypeScript example as the reproducer. Add the focused symbolic tests described in the acceptance criteria, including the alias case, and replay generated concrete cases in Node.js; done means both branches have no unsupported paths and existing typed field operations remain correct.
索引モデルが issue の本文から書いたものです。
説明
Problem
TypeScript permits assigning a value whose JavaScript type differs from a field's declared type when the receiver has a union type. The symbolic executor stores fields in separate regions by value sort. After selecting a concrete runtime class, a write of another sort cannot be represented by that class's declared field region. USVM #465 / PR #466 now reports that path as unsupported; it still needs a sound model.
Minimal TypeScript example
class Numeric {
value: number = 1;
numericOnly: boolean = true;
}
class Text {
value: string = "initial";
textOnly: boolean = true;
}
export function check(useNumeric: boolean): boolean {
const object = new (useNumeric ? Numeric : Text)();
object.value = "changed";
return object.value === "changed";
}
TypeScript accepts this code, and Node.js returns true for both check(true) and check(false). With PR #466, the Text branch is modeled and the Numeric branch is explicitly reported in unsupportedPaths because assigning a string changes the field's runtime value sort.
Expected support
Model the current value of an object field independently of its declared TypeScript type. A write that changes the JavaScript value type must replace the previous value; subsequent reads, including through aliases, must observe the new type and value. Branches that cannot yet be modeled should remain explicitly unsupported rather than produce a stale field value.
Acceptance criteria
- A focused symbolic test covers both branches with no unsupported paths and checks that both return
true. - The generated concrete cases replay in Node.js.
- A second test reads the changed field through an alias and confirms that the original field value is no longer visible.
- Existing typed numeric, Boolean, reference, and
anyfield operations remain correct.
Related: #465 and PR #466. This task concerns value type changes after assignment, not constructor selection.
- 主要言語
- Kotlin
- スター
- 33
- フォーク
- 27
- 平均マージ
- 2日 20時間
- マージ済み PR(30日)
- 9
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
UnitTestBot/usvm のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
UnitTestBot/usvm#465 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
UnitTestBot/usvm#462 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
UnitTestBot/usvm#457 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
UnitTestBot/usvm#440 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
UnitTestBot/usvm#439 ·
メンテナーはふだん 1 日以内に返信
UnitTestBot/usvm の issue をすべて見る
似ている issue
-
area/docs
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
nightscout/AndroidAPS#5199 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
edi-adapter-client enhancement helsemelding-edi-adapter
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
navikt/helsemelding-edi-adapter#102 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
navikt/esyfo-narmesteleder#615 ·
メンテナーはふだん 1 日以内に返信