TypeScript
TypeScript thinks the comparison appears to be unintentional
TypeScript determined that the compared values cannot both satisfy the condition because their types do not overlap in a way that makes the comparison meaningful.
TypeScript
TypeScript determined that the compared values cannot both satisfy the condition because their types do not overlap in a way that makes the comparison meaningful.
Observed message
error TS2367: This comparison appears to be unintentional because the types 'X' and 'Y' have no overlap.
Why it happens
How to fix it
Official reference
TypeScript Docs: NarrowingRelated errors
Explore more