TypeScript Version: 3.0.1 with --strict
class A {
public m(a:string|null): string {
return "";
}
}
class B extends A {
public m(a:string): string {
return "";
}
}
Expected behavior:
Error message
Actual behavior:
No error
B.m override the method A.m so the following code is valid.
let a:A = new B()
a.m(null);
But now B.m is called with null this violates the typing.