Closed
Description
TypeScript Version:
1.9.0-dev.20160502
Code
const xs = [1,2,3];
const ys = [4,5];
xs.push(...ys);
Compiled with tsc --target es6 --strictNullChecks test.ts
Expected behavior:
Compile without errors (without --target es6
option, the code compiles successfully)
Actual behavior:
Errors are emitted:
test.ts(3,9): error TS2345: Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
Type 'undefined' is not assignable to type 'number'.
Seems like values are treated nullable. (similar to #8357)