Closed
Description
From #6538
interface Animal {
animal;
}
interface Dog extends Animal {
dog;
}
interface Car {
car;
}
let thing: Dog | Car;
function isAnimal(x: Car | Dog): x is Animal {
return "animal" in x;
}
Currently we just report
Type 'Animal' is not assignable to 'Car | Dog'.
etc.
But that should be the elaboration. The first thing the user sees should be something like
A type guard's type must be assignable to its parameter's type.`
Type 'Animal' is not assignable to 'Car | Dog'.
etc.