[TS] Support field assignments that change the runtime value sort
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- kotlin, typescript
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Kotlin
- Estrellas
- 33
- Forks
- 27
- Merge medio
- 2 d 20 h
- PR fusionados (30 d)
- 10
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de UnitTestBot/usvm
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
UnitTestBot/usvm#465 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
UnitTestBot/usvm#462 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
UnitTestBot/usvm#457 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
UnitTestBot/usvm#440 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
UnitTestBot/usvm#439 ·
Los mantenedores suelen responder en 1 día
Todos los issues de UnitTestBot/usvm
Issues similares
-
good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Bookmarking an article that is already bookmarked under its redirect URL deletes both bookmarksPosiblemente ocupada @aakarshitv la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
kiwix/kiwix-android#5176 ·
Los mantenedores suelen responder en 1 día
-
[Device support] OPPO CPH2773Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
d4rken-org/amply#135 ·
Los mantenedores suelen responder en 1 día
-
[c7#258] fix(embedded): scheduled user task delivery runs on the service task worker executorAbiertoSource: c7 Type: bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
navikt/esyfo-narmesteleder#654 ·
Los mantenedores suelen responder en 1 día