[TS] Support field assignments that change the runtime value sort
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- kotlin, typescript
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Kotlin
- Stelle
- 33
- Fork
- 27
- Merge medio
- 3g 8h
- PR unite (30g)
- 7
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di UnitTestBot/usvm
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
UnitTestBot/usvm#465 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
UnitTestBot/usvm#462 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
UnitTestBot/usvm#457 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
UnitTestBot/usvm#440 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
UnitTestBot/usvm#439 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di UnitTestBot/usvm
Issue simili
-
design
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
sqldelight/sqldelight#6382 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
521xueweihan/HelloGitHub#3846 ·
-
Despair Manga: URL changedApertaBug Domain changed
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
keiyoushi/extensions-source#19624 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100