microsoft / microsoft/TypeScript
Declaration emit differs for negative numeric const literals
Offen
@jakebailey arbeitet bereits daran.
Seit 01.6.2026.
- #4158 von @copilot-swe-agent — ohne Merge geschlossen
Possible Improvement
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 132
Beschreibung
## 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;
```
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.