{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/1805","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/1805/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/1805/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/1805/events","html_url":"https://github.com/Microsoft/TypeScript/issues/1805","id":55448132,"number":1805,"title":"Union types not working with old-style overloads","user":{"login":"nycdotnet","id":3755379,"avatar_url":"https://avatars.githubusercontent.com/u/3755379?v=3","gravatar_id":"","url":"https://api.github.com/users/nycdotnet","html_url":"https://github.com/nycdotnet","followers_url":"https://api.github.com/users/nycdotnet/followers","following_url":"https://api.github.com/users/nycdotnet/following{/other_user}","gists_url":"https://api.github.com/users/nycdotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/nycdotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nycdotnet/subscriptions","organizations_url":"https://api.github.com/users/nycdotnet/orgs","repos_url":"https://api.github.com/users/nycdotnet/repos","events_url":"https://api.github.com/users/nycdotnet/events{/privacy}","received_events_url":"https://api.github.com/users/nycdotnet/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Needs%20Proposal","name":"Needs Proposal","color":"556b75"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Suggestion","name":"Suggestion","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-01-26T05:32:51Z","updated_at":"2015-02-04T17:02:53Z","closed_at":null,"body":"I was just working with Big.js and tried to pass a union type into its constructor function.  It seems that union types don't play nice with old-style overloaded constructors.  Please consider the code below that errors with TypeScript 1.4.  I would have expected this to work.\r\n\r\n```typescript\r\n\r\ninterface BigJS_Constructors {\r\n    new (value: number): BigJS;\r\n    new (value: string): BigJS;\r\n    new (value: BigJS): BigJS;\r\n}\r\n\t\r\ninterface BigJS extends BigJS_Constructors {\r\n    abs(): BigJS;\r\n\t/* more... */\r\n}\r\n\r\nvar Big : BigJS;\r\n\r\nclass MyThing {\r\n\tpublic value : BigJS;\r\n\tconstructor(value: number | string | BigJS) {\r\n\t\tthis.value = new Big(value); //This is an error in 1.4.\r\n\t}\r\n}\r\n```\r\n\r\nIf I change the `new` signature under `BigJS_Constructors` to `new (value: number | string | BigJS) : BigJS;`, and eliminate the other two options, it works fine, but to me the two styles should be identical in this case.\r\n\r\nMy apologies if I'm doing something stupid here.  Thanks!\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/72893618","html_url":"https://github.com/Microsoft/TypeScript/issues/1805#issuecomment-72893618","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/1805","id":72893618,"user":{"login":"nycdotnet","id":3755379,"avatar_url":"https://avatars.githubusercontent.com/u/3755379?v=3","gravatar_id":"","url":"https://api.github.com/users/nycdotnet","html_url":"https://github.com/nycdotnet","followers_url":"https://api.github.com/users/nycdotnet/followers","following_url":"https://api.github.com/users/nycdotnet/following{/other_user}","gists_url":"https://api.github.com/users/nycdotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/nycdotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nycdotnet/subscriptions","organizations_url":"https://api.github.com/users/nycdotnet/orgs","repos_url":"https://api.github.com/users/nycdotnet/repos","events_url":"https://api.github.com/users/nycdotnet/events{/privacy}","received_events_url":"https://api.github.com/users/nycdotnet/received_events","type":"User","site_admin":false},"created_at":"2015-02-04T17:02:53Z","updated_at":"2015-02-04T17:02:53Z","body":":+1:"}}