{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12323","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12323/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12323/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12323/events","html_url":"https://github.com/Microsoft/TypeScript/issues/12323","id":189967922,"number":12323,"title":"Duplicate identifier 'Promise' (TS2529) too restrictive.","user":{"login":"electricessence","id":5899455,"avatar_url":"https://avatars.githubusercontent.com/u/5899455?v=3","gravatar_id":"","url":"https://api.github.com/users/electricessence","html_url":"https://github.com/electricessence","followers_url":"https://api.github.com/users/electricessence/followers","following_url":"https://api.github.com/users/electricessence/following{/other_user}","gists_url":"https://api.github.com/users/electricessence/gists{/gist_id}","starred_url":"https://api.github.com/users/electricessence/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electricessence/subscriptions","organizations_url":"https://api.github.com/users/electricessence/orgs","repos_url":"https://api.github.com/users/electricessence/repos","events_url":"https://api.github.com/users/electricessence/events{/privacy}","received_events_url":"https://api.github.com/users/electricessence/received_events","type":"User","site_admin":false},"labels":[{"id":371615203,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Working%20as%20Intended","name":"Working as Intended","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-17T07:55:47Z","updated_at":"2016-11-18T01:14:36Z","closed_at":null,"body":"<!-- BUGS: Please use this template. -->\r\nError:(8, 9) TS2529:Duplicate identifier 'Promise'. Compiler reserves name 'Promise' in top level scope of a module containing async functions.\r\n\r\n**TypeScript Version:**  2.1.1 (targeting ES5)\r\n**Code**\r\n\r\n```ts\r\nimport {Promise} from \"myOwnPromiseLib\";\r\n```\r\nWhat I'm confused about is when I look at the ```__awaiter``` code it expects ```Promise``` (P) to be available.\r\nIn a modular environment, how else am I supposed to inject my own Promise lib so it can use it?\r\n\r\n```js\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n    return new (P || (P = Promise))(function (resolve, reject) {\r\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n        step((generator = generator.apply(thisArg, _arguments)).next());\r\n    });\r\n};\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/261421045","html_url":"https://github.com/Microsoft/TypeScript/issues/12323#issuecomment-261421045","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12323","id":261421045,"user":{"login":"electricessence","id":5899455,"avatar_url":"https://avatars.githubusercontent.com/u/5899455?v=3","gravatar_id":"","url":"https://api.github.com/users/electricessence","html_url":"https://github.com/electricessence","followers_url":"https://api.github.com/users/electricessence/followers","following_url":"https://api.github.com/users/electricessence/following{/other_user}","gists_url":"https://api.github.com/users/electricessence/gists{/gist_id}","starred_url":"https://api.github.com/users/electricessence/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electricessence/subscriptions","organizations_url":"https://api.github.com/users/electricessence/orgs","repos_url":"https://api.github.com/users/electricessence/repos","events_url":"https://api.github.com/users/electricessence/events{/privacy}","received_events_url":"https://api.github.com/users/electricessence/received_events","type":"User","site_admin":false},"created_at":"2016-11-18T01:14:36Z","updated_at":"2016-11-18T01:14:36Z","body":"Ok, now I'm more interested how I can simply keep using my own helpers and not require a global reference.\r\n\r\nI've got this working the way I want at the moment, but now I'm getting:\r\n```\r\nError:TS2318:Cannot find global type 'Promise'.\r\n```"}}
{"actor":{"display_login":"electricessence"}}