An inline object type on a parameter or local is emitted as TypeScript text
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
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- backend-api-design, compilers
Direzione di ricerca
Start by reading the lowering paths that emit types and object literals for the Dafny and Lean backends, then find the tests covering synthetic names for interface fields and return types. Add regression coverage for the sumA parameter and mk local annotation; the issue is done when both examples either resolve on both backends or produce an lsc error naming the inline type.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
SPEC.md says anonymous object types in interface fields and in function return types get synthetic datatype names (SpecEntryDecision, ParseSpecYamlResult). The same type written on a parameter or a local variable gets no name. Both backends emit the TypeScript spelling as a type name, and the generated files do not parse.
Reproduced on upstream main at 36eb31d (LemmaScript 0.6.8).
Reproduction
export function sumA(p: { x: number; y: number }): number {
return p.x + p.y;
}
export function mk(n: number): number {
const r: { k: number } = { k: n };
return r.k;
}
lsc gen --backend=dafny emits:
type { x: number; y: number }(==)
function sumA(p: { x: number; y: number }): int
{
(p.x + p.y)
}
function mk(n: int): int
{
var r := (n);
r.k
}
dafny resolve stops at the first line with invalid Ident. mk also lowers the record literal to (n), which has no field k.
lsc gen --backend=lean emits opaque { x: number; y: number } : Type and def sumA (p : { x: number; y: number }) : Int, and lowers the literal to let r := { k := n }.
A named alias, type Pt = { x: number; y: number }, works in the parameter position.
Expected
Either the parameter and local positions get synthetic names, as interface fields and return types do (for example SumAP and MkR), or lsc rejects an inline object type in those positions with a message that suggests a named alias. Both backends fail loudly today, so no false proof results; the cost is valid TypeScript that does not compile and an error message that points at generated text.
Acceptance criteria
sumAandmkabove either generate code that resolves on both backends or are rejected bylscwith an error naming the inline type.- A regression test covers an inline object type on a parameter and on a local annotation.
- Lingua principale
- TypeScript
- Stelle
- 113
- Fork
- 13
- Merge medio
- 15h 35m
- PR unite (30g)
- 56
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 midspiral/LemmaScript
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
midspiral/LemmaScript#355 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
In a pure function body, a `const` declared inside an `if` branch stays in scope after the `if`, so a false `ensures` can verifyForse già presa @namin l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
midspiral/LemmaScript#362 ·
I maintainer di solito rispondono entro 1 giorno
-
A `const` or `let` inside a bare `{ }` block stays in scope after the block, so a false `ensures` can verifyForse già presa @namin l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 15/100
midspiral/LemmaScript#361 ·
I maintainer di solito rispondono entro 1 giorno
-
A closure declared before a same-name `const` or `let` in its block reads the outer variable, so a false `ensures` can verifyForse già presa @namin l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 18/100
midspiral/LemmaScript#360 ·
I maintainer di solito rispondono entro 1 giorno
-
An assignment used as an expression, such as `(x = 7);` or `const y = (x = 7)`, is extracted as an equality test, so a false `ensures` can verifyForse già presa @namin l’ha presa oggi. Aperta
Difficoltà 3/5 Mezza giornata Idoneità per principianti 30/100
midspiral/LemmaScript#356 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di midspiral/LemmaScript
Issue simili
-
bug done
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
neavo/LinguaGacha#1124 ·
I maintainer di solito rispondono entro 1 giorno
-
[fullsend] E2E: backstage-microsoft-auth — catalogQuery missing error handler for network errorsForse già presa @fullsend-ai-coder l’ha presa oggi. Apertae2e-failure ready-to-code
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 78/100
redhat-developer/rhdh-plugin-export-overlays#4821 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
brylie/mission-island#225 ·
I maintainer di solito rispondono entro 1 giorno
-
status/need-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
google-gemini/gemini-cli#30412 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno