Duolith docs

Errors E0300 to E0399

E0348 Comparison that is always the same

Message {TypeScript's message} (TSnumber)

Words in italics are filled in when the compiler reports it, such as the element's name or the list of known ones.

Why

The two sides of the comparison have types that never overlap, such as a tone compared with a word its union does not have, so the comparison is always false (or always true) and the code it guards never runs, or always does.

How to fix it

Compare with a value the type can have; the misspelt word is usually the problem.

In a terminal

duolith explain E0348

Mentioned in