Closed
Description
TypeScript Version: 2.3.4 or 2.4.1
Code
interface A {
params?: { name: string; }
}
class Test<T extends A> {
attrs: Readonly<T>;
m() {
this.attrs.params!.name;
}
}
Expected behavior:
no errors
Actual behavior:
Error: Property 'name' does not exist on type 'T["params"]'.
If I remove Readonly
or get rid of generic param T
then everything will be ok.