microsoft / microsoft/TypeScript
Declaration emit differs for negative numeric const literals
Aperta
Possible Improvement
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 2g 4h
- PR unite (30g)
- 132
Descrizione
## Steps to reproduce
`main.ts`:
```ts
export const a = -1e500 as const;
export const b = -123456789012345678901234567890 as const;
```
```sh
tsgo --declaration main.ts
```
## Behavior with `typescript@6.0`
```ts
export declare const a: -1e500;
export declare const b: -123456789012345678901234567890;
```
## Behavior with `tsgo`
```ts
export declare const a: -Infinity;
export declare const b: -1.2345678901234568e+29;
```
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.