Skip to content
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

.toHaveProperty() does not distinguish between any and never #64

Closed
mrazauskas opened this issue Mar 19, 2024 · 1 comment
Closed

.toHaveProperty() does not distinguish between any and never #64

mrazauskas opened this issue Mar 19, 2024 · 1 comment

Comments

@mrazauskas
Copy link
Contributor

Playground link

.toHaveProperty() does not distinguish between any and never. See the link above.

It sound like never should not have any properties. Might be I missed something.

@aryaemami59
Copy link
Collaborator

@mrazauskas Technically both keyof never and keyof any resolve to string | number | symbol. Not sure if it would be the best idea to stray away from TypeScript's intended behavior but you're right. Semantically it doesn't make sense. It seems like keyof never should be never. Not sure what the best approach here would be to be honest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants