TypeScript Version: 2.1.4
Code
interface I {
a: string;
}
function f1<T extends Partial<I>>() {
// Error TS2322
let i: T = {};
}
function f2<T extends I>() {
// Error TS2322
let i: Partial<T> = {};
}
Expected behavior:
No errors
Actual behavior:
Error TS2322: Type '{}' is not assignable to type 'T' / 'Partial'
Forgive me if this is simply a limitation of the Typescript engine and the implementation of Partial, but I don't know enough about the internals to make a judgement there.