Closed
Description
TypeScript Version: 3.2.0-dev.201xxxxx
Search Terms: interface, optional parameter
Code
interface IRunner {
run(s?: string): void;
}
class Runner implements IRunner {
run(s: string): void {
console.log(s.length);
}
}
const runner: IRunner = new Runner();
runner.run(undefined);
Expected behavior:
Compilation error once strictNullChecks like TS2416: Type '(s: string) => void' is not assignable to type '(s?: string | undefined) => void'.
Actual behavior:
No compilation errors.