-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No errors on apparent type of bigint or symbol, even for recent targets #49104
Conversation
`BigInt` isn't resolved whenever `lib < es2020`, but it's not an error when `target < es2020`. I have a few ideas for improving this situation but for the RC I'm going to remove `bigint` from Object.freeze's signature.
In discussion by the team, we decided that the checker should never error when a primitive like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original comment is out of date, but given your last comment
In discussion by the team, we decided that the checker should never error when a primitive like
bigint
orsymbol
can't resolve its associated apparent type. I removed the error message and restoredbigint
to Object.freeze in es5.d.ts.
I think this is the right call. Referencing BigInt
directly probably shouldn't work; however, trying to resolve the apparent type to BigInt
for bigint
(or to any new wrapper type of any new primitive) is something that should have a reasonable fallback behavior; nobody should get an error for that. Furthermore, the apparent type should be {}
so that it is effectively opaque (other than the fact that it's "not null
/undefined
).
That seems to be the behavior of this PR, so 👍🏻
@typescript-bot cherry-pick this to release-4.7 |
Heya @DanielRosenwasser, I've started to run the task to cherry-pick this into |
Hey @DanielRosenwasser, I've opened #49135 for you. |
Component commits: 4c6e802 Remove bigint from Object.freeze in es5.d.ts `BigInt` isn't resolved whenever `lib < es2020`, but it's not an error when `target < es2020`. I have a few ideas for improving this situation but for the RC I'm going to remove `bigint` from Object.freeze's signature. 6d5bf6a Update other baselines e1958f7 No errors for missing apparent type of bigint,symbol for any target 86fc8db Update test text
Component commits: 4c6e802 Remove bigint from Object.freeze in es5.d.ts `BigInt` isn't resolved whenever `lib < es2020`, but it's not an error when `target < es2020`. I have a few ideas for improving this situation but for the RC I'm going to remove `bigint` from Object.freeze's signature. 6d5bf6a Update other baselines e1958f7 No errors for missing apparent type of bigint,symbol for any target 86fc8db Update test text Co-authored-by: Nathan Shively-Sanders <nathansa@microsoft.com>
BigInt
isn't resolved wheneverlib < es2020
, but it's not an error whentarget < es2020
. I have a few ideas for improving this situation but for the RC I'm going to removebigint
from Object.freeze's signature.Update: In discussion by the team, we decided that the checker should never error when a primitive like bigint or symbol can't resolve its associated apparent type. I removed the error message and restored bigint to Object.freeze in es5.d.ts.
Fixes #49101