-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
In DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
π Search Terms
infinity number literal
π Version & Regression Information
- This changed in PR Disallow numeric literals with negative numbersΒ #55268
β― Playground Link
π» Code
type PositiveInfinity = 1e999;
// ^?
type NegativeInfinity = -1e999;
// ^?
π Actual behavior
In TS 5.2 we get NumberLiteralType
s with Infinity
and -Infinity
values.
In the upcoming TS 5.3 we get a number type in the of the PositiveInfinity
π Expected behavior
I don't know. I created this issue to discuss exactly that.
Should this part of the change be reverted and should Infinity
be allowed as a literal number value? Or should -Infinity
be aligned with Infinity
and should it be converted~ to a number
type as well?
Additional information about the issue
I didn't see an Infinity
as a literal type so I made this change while working in this area. @rbuckton commented here:
I really hope no one is relying on this.
but it turns out that some try to rely on this. We can see it in this issue, cc @Max10240
Max10240
Metadata
Metadata
Assignees
Labels
In DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript