- Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Closed
Copy link
Labels
Design LimitationConstraints of the existing architecture prevent this from being fixedConstraints of the existing architecture prevent this from being fixed
Description
TypeScript Version: 2.0.0
Code
// strictNullChecks is on var x: number[] = []; var y: number = x[0]; y.toString(); // Cannot read property 'toString' of undefined
Expected behavior:
error TS2322: Type 'undefined' is not assignable to type 'number'
Actual behavior:
after compile with command tsc --strictNullChecks
Runtime exception: Cannot read property 'toString' of undefined
I thought strictNullChecks a there to prevent developer from seeing such kind of exceptions in run time.
SlurpTheo
Metadata
Metadata
Assignees
Labels
Design LimitationConstraints of the existing architecture prevent this from being fixedConstraints of the existing architecture prevent this from being fixed