[TS] Construct project class instances from runtime constructor values
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 38/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- kotlin, node.js, typescript
- 領域
- compilers, testing-qa
研究方向
Start by tracing how the TypeScript symbolic executor allocates new expressions and how JacoDB EtsIR represents evaluated constructor operands, with dependency UnitTestBot/jacodb#398 in view. Add a focused symbolic test covering both classes, constructor identity, evaluation order, and unsupported values, then replay generated inputs and results in Node.js. Done means direct construction and existing instanceof behavior still pass, while unsupported and failed cases remain distinct.
由索引模型根據 Issue 內容生成。
描述
Problem
The TypeScript symbolic executor allocates new expressions by an EtsIR class type. That cannot execute new through an evaluated constructor value: a variable or call may choose between classes with the same static type. The JacoDB frontend currently marks this form unsupported while its EtsIR representation is being extended.
Minimal TypeScript example
class A { value: number; constructor(value: number) { this.value = value; } }
class B { value: number; constructor(value: number) { this.value = value; } }
function choose(useA: boolean): typeof A | typeof B {
return useA ? A : B;
}
export function check(useA: boolean): boolean {
const value = new (choose(useA))(7);
return value instanceof A && value.value === 7;
}
Node.js returns true for check(true) and false for check(false).
Expected support
Consume the evaluated constructor operand from JacoDB EtsIR and allocate an instance of the selected project class. Invoke that class's constructor once with the evaluated arguments; preserve callee-before-arguments order and constructor identity across calls and local aliases. Keep unknown or symbolic constructor identities explicitly unsupported until they have a sound model. A non-constructable value must not silently allocate an instance.
Acceptance criteria
- A focused symbolic test obtains both outcomes from one static constructor-union type, with unsupported and failures reported separately.
- Generated concrete inputs and results replay in Node.js, including a constructor returned by another function and an argument that mutates the constructor variable after the callee has been selected.
- Direct
new A()and existinginstanceofbehavior remain correct.
Dependency: UnitTestBot/jacodb#398. Related: JacoDB #396 for declared class runtime values and USVM #457 for runtime instanceof.
- 主要語言
- Kotlin
- 星號
- 33
- 分支
- 28
- 平均合併
- 2 天 19 小時
- 30 天內合併 PR
- 76
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
UnitTestBot/usvm 的其他 Issue
-
[TS PBT] Save campaign-file artifacts before stdout publication可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 74/100
UnitTestBot/usvm#612 ·
維護者通常 1 天內回覆
-
[TS PBT] Preserve class verification after expected PBT budget expiry可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 5/5 一週以上 新手友好度 18/100
UnitTestBot/usvm#618 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 25/100
UnitTestBot/usvm#613 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 43/100
UnitTestBot/usvm#604 ·
維護者通常 1 天內回覆
-
難度 5/5 一週以上 新手友好度 25/100
UnitTestBot/usvm#592 ·
維護者通常 1 天內回覆
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
AAswordman/Operit#1457 ·
維護者通常 8 天內回覆
-
難度 1/5 1 小時以內 新手友好度 62/100
JetBrains/klibs-io#606 · 1 則留言 ·
維護者通常 1 天內回覆
-
Python: zadd stringifies bytes/bytearray/memoryview members (silent data corruption), including in Batch可能已有人在做 @prateek-kumar-improving 今天認領。 未關閉bug 🐞 python 🐍
難度 2/5 1-3 小時 新手友好度 62/100
valkey-io/valkey-glide#7521 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 80/100
open-telemetry/opentelemetry-android#2183 ·
維護者通常 2 天內回覆
-
難度 1/5 1 小時以內 新手友好度 62/100
Droid-Deck/DroidDeck#2058 ·
維護者通常 1 天內回覆