microsoft / microsoft/TypeScript

Design Meeting Notes, 2026-06-23

Offen
#63,674 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Design Notes
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.3k
Ø Merge
2 T. 4 Std.
Gemergte PRs (30 T.)
132

Beschreibung

# `isolatedDeclarations` and Control Flow Analysis

https://github.com/microsoft/typescript-go/pull/4367

* Want to be able to infer types for trivial expressions in `isolatedDeclarations` in a function block.
* Specifically in discussion is if there are no return statements.
* But what happpens when you have a `never`-returning call? That can cause a `never`.
* Feels like anything with multiple statements in the body is questionable.
* We *could* make a special-case for `() => {}`.
* Probably enough to just say "just write `void`".
* Feels bad to say we can't come up with a type for `() => {}`
* Why? Feels like it's not a big deal?
* Well it's even more trivial than a single expression being returned.
* Sure, but the reason we added trivial expression inference was because people often have bigger structures of objects that are nested. So the triviality was not really about writing small expressions.
* One reason why we didn't do it (we think) is that we don't want to close the door to ourselves on how `void` vs. `undefined` is inferred for no-return-expression functions.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die Diskussion im Issue und den verknüpften Pull Request microsoft/typescript-go#4367 zu lesen. Kläre das beabsichtigte Verhalten von isolatedDeclarations für Funktionskörper ohne return-Anweisungen, einschließlich Aufrufen, die niemals zurückkehren, und der Unterscheidung zwischen void und undefined. Als erledigt gilt die Aufgabe, wenn das Projekt ein abgestimmtes Verhalten und einen entsprechenden Implementierungsumfang festgelegt hat.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
compilers
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Ruhig
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.