microsoft / microsoft/TypeScript

Declaration emit differs for negative numeric const literals

未关闭
#63,831 1 条评论 1 个 reaction 已指派 2 人 已被 @jakebailey 认领 在 GitHub 查看
Possible Improvement
主要语言
Go
星标
111k
派生
14.3k
平均合并
2 天 4 小时
30 天内合并 PR
132

描述

## 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;
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。