Skip to content

Declaration emit differs for negative numeric const literals #4116

@mds-ant

Description

@mds-ant

Steps to reproduce

main.ts:

export const a = -1e500 as const;
export const b = -123456789012345678901234567890 as const;
tsgo --declaration main.ts

Behavior with typescript@6.0

export declare const a: -1e500;
export declare const b: -123456789012345678901234567890;

Behavior with tsgo

export declare const a: -Infinity;
export declare const b: -1.2345678901234568e+29;

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions