You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type '<T>() => (T extends true ? true : false) & boolean' is not assignable to
type '<T>() => (T extends true ? true : false) & boolean'.
Two different types with this name exist, but they are unrelated.
Type 'false' is not assignable to type '(T extends true ? true : false) & boolean'.
Also, the following unexpectedly removes the error message:
Removing & boolean
Replacing T extends true ? true : false by true
Replacing T extends true ? true : false by T extends true ? true : true
Replacing b's type by typeof a
🙂 Expected behavior
Since the two types are identical, a and b should be assignable to each other.
The text was updated successfully, but these errors were encountered:
Sorry for a bit unrelated comment (it's too long to search for similar issues and I'm too lazy to create a new one), but similar thing happening here when I try to return 1 and 2. It throws error saying Type '1' is not assignable to type 'Options["enabled"] extends true ? 1 : 2'.ts(2322).
Uh oh!
There was an error while loading. Please reload this page.
🔎 Search Terms
"same type assignable"
"Two different types with this name exist, but they are unrelated."
🕗 Version & Regression Information
Please keep and fill in the line that best applies:
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
This produces the following error message:
Also, the following unexpectedly removes the error message:
& boolean
T extends true ? true : false
bytrue
T extends true ? true : false
byT extends true ? true : true
b
's type bytypeof a
🙂 Expected behavior
Since the two types are identical,
a
andb
should be assignable to each other.The text was updated successfully, but these errors were encountered: