- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.1k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingThe issue relates to error messagingFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
Reported in the IRC channel against 1.7.5. Still exists in 1.8.0-dev.20160117
var x: [number] = [];foo.ts(1,5): error TS2322: Type 'undefined[]' is not assignable to type '[number]'.
  Property '0' is missing in type 'undefined[]'.
I guess undefined comes from the fact that the RHS array is empty, so its element type is left uninitialized. Maybe you want to detect that and have a different error message? "An empty array is not assignable to type [number]." or something.
NilayiFour and smartlypradeep
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingThe issue relates to error messagingFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this