Closed
Description
TypeScript Version: 3.0.0-dev.20180628
Search Terms: infer nested type object
Code
class Foo<A> {
private a: A;
}
class ObjectFoo<A> extends Foo<A> {
constructor(private b: { [k in keyof A]: Foo<A[k]> }) {
super();
}
}
const a = new ObjectFoo({ b: new Foo<string>() });
const obj = new ObjectFoo({ a });
Expected behavior:
Expect obj
to have type { a: { b: string } }
Actual behavior:
obj
has type { a: { b: any } }
Playground Link:
playground
Related Issues: