-
-
Notifications
You must be signed in to change notification settings - Fork 679
merge-deep: wrong types inferred when using partial interfaces #1314
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug description
the correct operation of this utility depends on the order of types!
Let's say there is interface Pokemon like this:
import type {MergeDeep} from 'type-fest';
interface Pokemon {
name: string;
type: string;
}valid :
const testThroughAssert: Pokemon = {} as MergeDeep<
Partial<Pokemon>,
Pokemon
>;=> success
invalid:
const testThroughAssert: Pokemon = {} as MergeDeep<
Pokemon,
Partial<Pokemon>
>;=> error TS2322: Type '{ name?: string | undefined; type?: string | undefined; }' is not assignable to type 'Pokemon'.
Repro
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working