Checker accepts definite assignment assertions on static fields

Aperta
#3,635 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp, typescript
Ambito
compilers

Direzione di ricerca

Start with the repro class C { static value!: number; } and run it with --no-tsconfig --strict --noEmit against the SharpTS checker; it currently passes when it should fail. The payload names no source file, so locate where the checker validates definite assignment assertions on class property declarations and where static members are handled. Done means the checker reports the TypeScript TS1255 error for a static field with !, and the instance-field case still behaves as before. Related context is in #3621.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

class C { static value!: number; }

SharpTS at 72455db66 accepts this with --no-tsconfig --strict --noEmit. TypeScript 6.0.3 reports TS1255 with --ignoreConfig --strict --target ES2022 --noEmit because a definite assignment assertion is disallowed on a static field.

Found while verifying the static-field read diagnostic in #3621.

Lingua principale
C#
Stelle
156
Fork
4
Merge medio
16h 37m
PR unite (30g)
41

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nickna/SharpTS

Tutte le issue di nickna/SharpTS

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.