Closed
Description
Vue version
3.4.21
Link to minimal reproduction
Steps to reproduce
withDefaults(
defineProps<
{
def: string
} & (
| {
type: 'hello'
results: string
}
| {
type: 'world'
results: number
}
)
>(),
{
def: 'default value!',
}
)
What is expected?
Expected type from this would be:
type ExpectedType = {
readonly def: string;
readonly type: 'hello';
readonly results: string;
} | {
readonly def: string;
readonly type: 'world';
readonly results: number;
}
What is actually happening?
type actualType = {
readonly type: "hello" | "world";
readonly results: string | number;
readonly def: string;
}
System Info
No response
Any additional comments?
The problem is with Typescripts utility type Omit. See: microsoft/TypeScript#54451 and microsoft/TypeScript#53169