nullish reached transform crash on ?? chain over optional record fields
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
- 58/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
Línea de trabajo
Start by running lsc check --backend=dafny repro.verify.ts with the 15-line reproduction in the issue; the failure occurs during generation before Dafny runs. Trace how the inline optional record type and chained ?? expression pass through narrowing and the transform. Done when this reproduction generates and verifies cleanly, while the named-interface version still works.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
lsc check --backend=dafny crashes during generation on a chained ?? over optional record fields when the parameter uses an inline object type. The identical body with a named interface verifies clean.
export function f(
- entry: { x: number; y?: number } | undefined, // crash: nullish reached transform
+ entry: Entry | undefined, // verifies clean
context: Ctx
): number {
if (entry !== undefined) {
const w = context.a ?? entry.y ?? context.b ?? 0;
return w;
}
return -1;
}
Evidence
- Before:
ERROR: nullish reached transform — narrow should have rewritten it: {"kind":"nullish","left":{"kind":"someMatch",...,"field":"a",...}}(exit 1, pre-Dafny; full log in first comment if needed) - After: named interface generates and verifies with an empty lemma body —
Dafny program verifier finished with 1 verified, 0 errors
Minimal repro (15 lines, repro.verify.ts):
//@ backend dafny
interface Ctx {
a?: number;
b?: number;
}
export function f(
entry: { x: number; y?: number } | undefined,
context: Ctx
): number {
//@ verify
if (entry !== undefined) {
const w = context.a ?? entry.y ?? context.b ?? 0;
return w;
}
return -1;
}
Run: lsc check --backend=dafny repro.verify.ts (lsc 0.6.6; Dafny/Z3 irrelevant, crash is pre-Dafny).
Merge Danger
Door: two-way
Workaround exists (extract a named interface; zero behavior change), and the crash is generation-only — no faulty proofs escape, the run fails loud.
Blast radius: toolchain
Any file combining inline optional object types with ?? chains is unverifiable until fixed. Related gap (same session, separate report on request): const initializers do not narrow (const fresh = entry !== undefined && ... leaves entry un-narrowed on the right side; SPEC §3.9 lists if/?:/bare-statement only).
- Lenguaje dominante
- TypeScript
- Estrellas
- 113
- Forks
- 13
- Merge medio
- 16 h 22 min
- PR fusionados (30 d)
- 40
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 midspiral/LemmaScript
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
midspiral/LemmaScript#308 ·
Los mantenedores suelen responder en 1 día
-
Dafny: `toUpperCase`/`toLowerCase` are modeled as ASCII-only, so false contracts about non-ASCII text verifyPosiblemente ocupada @quangng2000 la tomó hace 1 día. Abierto
midspiral/LemmaScript#312 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 1-2 días Aptitud para principiantes 56/100
midspiral/LemmaScript#311 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 48/100
midspiral/LemmaScript#310 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 67/100
midspiral/LemmaScript#309 ·
Los mantenedores suelen responder en 1 día
Todos los issues de midspiral/LemmaScript
Issues similares
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 83/100
gofish-graphics/gofish-graphics#1384 ·
Los mantenedores suelen responder en 1 día
-
adapter bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Olanetsoft/agent-lookout#353 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
vicharanashala/vibe#1542 ·
Los mantenedores suelen responder en 1 día
-
bug chore P2 size:XS
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
josephfung/curia#2666 ·
Los mantenedores suelen responder en 1 día
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
devarshishimpi/codra#178 ·
Los mantenedores suelen responder en 1 día