Open kylegoetz opened 2 years ago
The behavior is correct and consistent with TypeScript's Partial utility type.
Partial
basically transforms key: A
to key: A | undefined
or key?: A
.
interface Foo {
foo: string
}
const partialFoo: Partial<Foo> = {foo: 4} //Type 'number' is not assignable to type 'string'
Consider
I think instead of should be
Right
with the value contained inside{}
because{ foo: 5 }
is of typePartial<{ foo: string }>
isn't it?Or is there something else that evaluates like this that isn't called
partial
?