Closed
Description
For example, a following signature of function f
should be defined like function g
with strictNullChecks option.
TypeScript Version: master
Code
function f(a?: number) {
}
f();
f(0);
f(undefined);
function g()
function g(a: number)
function g(a?: number) {
}
g();
g(0);
g(undefined);
Expected behavior:
$ node built/local/tsc.js --strictNullChecks index.ts
index.ts(5,3): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'number'.
index.ts(13,3): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'number'.
Actual behavior:
$ node built/local/tsc.js --strictNullChecks index.ts
index.ts(13,3): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'number'.