Closed
Description
TypeScript Version: 2.4.2
Code
class Value<T> {
constructor(protected readonly data: T) {}
public bar(data: Partial<T>): this {
return this;
}
}
interface Type {
foo: string;
}
class TheClass<T extends Type> extends Value<T> {
public foo(): this {
return this.bar({foo: "d"});
}
}
Expected behavior:
No errors, since it should be aware T
extends Type
, which has foo
.
Actual behavior:
Shows an error:
Argument of type '{ foo: "d"; }' is not assignable to parameter of type 'Partial<T>'.