You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Declaration emit writes = Infinity initializers for overflowing number literals (invalid .d.ts, TS1254) #64760
This is the behavior in every version I tried, and I reviewed the FAQ for entries about declaration emit, Infinity and numeric literal types (none apply).
Tried: 6.0.3 (Playground) and main (7.1.0-dev, b5c34ba). Both emit the invalid = Infinity initializers; 6.0.3 also emits declare const _default: Infinity; for the default export.
Checking that file reports TS1254 on every initializer: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference." Infinity is an identifier, not a literal.
Related: #42905 (Infinity in type positions, fixed in 7.1), #63831 (-1e500 as const emitted as -Infinity) and #56272 (whether overflowing literals should have an Infinity literal type at all). This issue is narrower: whatever the type is, the emitted .d.ts should be valid.
Activity