microsoft / microsoft/TypeScript
Infinities as number literal types
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Go
- Estrellas
- 111k
- Forks
- 14.4k
- Merge medio
- 1 d 19 h
- PR fusionados (30 d)
- 117
Descripción
🔎 Search Terms
infinity number literal
🕗 Version & Regression Information
- This changed in PR https://github.com/microsoft/TypeScript/pull/55268
⏯ Playground Link
💻 Code
type PositiveInfinity = 1e999;
// ^?
type NegativeInfinity = -1e999;
// ^?
🙁 Actual behavior
In TS 5.2 we get NumberLiteralTypes with Infinity and -Infinity values.
In the upcoming TS 5.3 we get a number type in the of the PositiveInfinity
🙂 Expected behavior
I don't know. I created this issue to discuss exactly that.
Should this part of the change be reverted and should Infinity be allowed as a literal number value? Or should -Infinity be aligned with Infinity and should it be converted~ to a number type as well?
Additional information about the issue
I didn't see an Infinity as a literal type so I made this change while working in this area. @rbuckton commented here:
I really hope no one is relying on this.
but it turns out that some try to rely on this. We can see it in this issue, cc @Max10240
Guía de contribución
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.
Línea de trabajo
Comienza con el ejemplo de Playground enlazado y compara el comportamiento de TypeScript 5.2 con el próximo comportamiento de 5.3 introducido por PR 55268. Revisa la discusión en ese pull request y en el issue 56270, y determina después el tratamiento previsto de la infinitud positiva y negativa antes de cambiar el comportamiento del compilador y su cobertura de regresión.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript
- Área
- compilers
- Tipo de issue
- Error
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100