microsoft / microsoft/TypeScript
Declaration emit differs for negative numeric const literals
Open
Possible Improvement
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- PR merge metrics
- PR metrics pending
Description
## 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;
```
Contributor guide
Assessment
This issue has not been assessed yet.