Skip to content

Conversation

@taiyakihitotsu
Copy link
Contributor

@taiyakihitotsu taiyakihitotsu commented Sep 28, 2025

This issue had already existed I think, and I missed it in a previous PR #1231.
Sorry about that.

type test_IsEqual = _IsEqual<never, unknown> // true

@som-sm
Copy link
Collaborator

som-sm commented Sep 28, 2025

Fails if the order the reversed, i.e., IsEqual<unknown, never> returns true (not false).

@taiyakihitotsu
Copy link
Contributor Author

taiyakihitotsu commented Sep 28, 2025

@som-sm

Thanks, I fixed it.

(Using [a & b, a | b] to determine which type is unknown and which is never failed in some "intersection with infer" test cases, so I wrote it in a more direct way.)

@som-sm som-sm changed the title is-equal: Fix unexpected true result for never and unknown IsEqual: Fix behaviour when instantiated with never and unknown Sep 28, 2025
@sindresorhus sindresorhus merged commit 785549f into sindresorhus:main Sep 28, 2025
6 checks passed
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

Successfully merging this pull request may close these issues.

3 participants