{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2958","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2958/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2958/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2958/events","html_url":"https://github.com/Microsoft/TypeScript/issues/2958","id":71958737,"number":2958,"title":"Suggestion: interface to allow overloading variables (similar to unions in C lang)","user":{"login":"sandeepkalra","id":5566402,"avatar_url":"https://avatars.githubusercontent.com/u/5566402?v=3","gravatar_id":"","url":"https://api.github.com/users/sandeepkalra","html_url":"https://github.com/sandeepkalra","followers_url":"https://api.github.com/users/sandeepkalra/followers","following_url":"https://api.github.com/users/sandeepkalra/following{/other_user}","gists_url":"https://api.github.com/users/sandeepkalra/gists{/gist_id}","starred_url":"https://api.github.com/users/sandeepkalra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandeepkalra/subscriptions","organizations_url":"https://api.github.com/users/sandeepkalra/orgs","repos_url":"https://api.github.com/users/sandeepkalra/repos","events_url":"https://api.github.com/users/sandeepkalra/events{/privacy}","received_events_url":"https://api.github.com/users/sandeepkalra/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Duplicate","name":"Duplicate","color":"f7c6c7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-29T19:00:10Z","updated_at":"2015-04-29T19:05:09Z","closed_at":"2015-04-29T19:03:18Z","body":"Hi,\r\n\r\nI have code that I want to rewrite in typescript, and for that I want to do few things that looks like this:\r\n```ts\r\ninterface msg {\r\n    x: number;\r\n    Run: ()=>string;\r\n    Run: (number) => string;\r\n}\r\n\r\ninterface msg {\r\n    Code: number;\r\n    Message: string;\r\n    Message: Object;\r\n}\r\n```\r\nand many more similar things. Typescript has concept of 'overload' for functions. This is almost in same lines and more probably in line with \"C\" 'unions' style.\r\n\r\nIs it possible to accept this as a feature request if this is not present and/or proposed yet for Typescript? \r\n\r\nThanks, \r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/97544537","html_url":"https://github.com/Microsoft/TypeScript/issues/2958#issuecomment-97544537","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2958","id":97544537,"user":{"login":"danquirk","id":7121557,"avatar_url":"https://avatars.githubusercontent.com/u/7121557?v=3","gravatar_id":"","url":"https://api.github.com/users/danquirk","html_url":"https://github.com/danquirk","followers_url":"https://api.github.com/users/danquirk/followers","following_url":"https://api.github.com/users/danquirk/following{/other_user}","gists_url":"https://api.github.com/users/danquirk/gists{/gist_id}","starred_url":"https://api.github.com/users/danquirk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danquirk/subscriptions","organizations_url":"https://api.github.com/users/danquirk/orgs","repos_url":"https://api.github.com/users/danquirk/repos","events_url":"https://api.github.com/users/danquirk/events{/privacy}","received_events_url":"https://api.github.com/users/danquirk/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T19:05:09Z","updated_at":"2015-04-29T19:05:09Z","body":"```ts\r\ninterface msg {\r\n    x: number;\r\n    Run: { \r\n\t\t(): string;\r\n\t\t(number): string \r\n\t}\r\n}\r\n\r\ninterface msg {\r\n    Code: number;\r\n    Message: string|Object;\r\n}\r\n```\r\n\r\nBut note that string|Object likely doesn't do what you want because everything is an Object."}}