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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Narrow doesn't work properly on intersections with {} type #300

Closed
DetachHead opened this issue Apr 9, 2022 · 1 comment
Closed

Narrow doesn't work properly on intersections with {} type #300

DetachHead opened this issue Apr 9, 2022 · 1 comment

Comments

@DetachHead
Copy link

馃悶 Bug Report

Describe the bug

Reproduce the bug

declare const foo: <T>(value: Narrow<T>) => void

foo<1 & {}>(2 as 2 & {}) //no error

Expected behavior

error, because 2 & {} is not assignable to 1 & {}

Possible Solution

Screenshots

Additional context

@DetachHead
Copy link
Author

this is fixed in typescript 4.8 beta. so i'll close this assuming it was a typescript issue

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

1 participant