Type guard not working on v-else
Vue version
3.3.4
Link to minimal reproduction
Steps to reproduce
- create a type with union types (A and B)
- create a type guard to check if the union type is of type A
- in a scoped slot use the type guard in a v-if
- add a v-else
What is expected?
in both v-if and v-else I expect Typescript to detect types A and B respectively
What is actually happening?
type A is correctly detected on v-if, but type B isn't on v-else and I get the union type instead
System Info
No response
Any additional comments?
I created a reproducible code, however I didn't know how to show the problem by hovering the "animal" in the v-else as the Vue Playground doesn't show Typescript errors, but I get it in VSCode