Checker accepts definite assignment assertions on static fields

Abierto
#3,635 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
csharp, typescript
Área
compilers

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
C#
Estrellas
156
Forks
4
Merge medio
16 h 37 min
PR fusionados (30 d)
41

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nickna/SharpTS

Todos los issues de nickna/SharpTS

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.