Closed
Description
TypeScript Version: 3.9.2, 4.0.1-rc
Search Terms: class no type error interface
Code
Unbelievably this is the minimal reproduction I was able to make.
interface I<Dummy, V> {
c: C<Dummy, V>;
}
class C<Dummy, V> {
declare sub: I<Dummy, V>;
declare covariance: V;
}
// should be a type error, but none emitted
const c1: C<unknown, string> = new C<unknown, number>();
Expected behavior:
new C<unknown, number>()
should not be assignable to C<unknown, string>
due to existence of the covariance
property.
TSC should emit an error like Type 'C<unknown, number>' is not assignable to type 'C<unknown, string>'.
Actual behavior:
No error.
Playground Link: link
Related Issues: none found (sorry, hard to explain the exact problem so no good search terms came up)