{"action":"created","issue":{"url":"https://api.github.com/repos/google/traceur-compiler/issues/2005","labels_url":"https://api.github.com/repos/google/traceur-compiler/issues/2005/labels{/name}","comments_url":"https://api.github.com/repos/google/traceur-compiler/issues/2005/comments","events_url":"https://api.github.com/repos/google/traceur-compiler/issues/2005/events","html_url":"https://github.com/google/traceur-compiler/issues/2005","id":116365714,"number":2005,"title":"InlineES6ModuleTransformer fails when two modules import to the same name.","user":{"login":"johnjbarton","id":205570,"avatar_url":"https://avatars.githubusercontent.com/u/205570?v=3","gravatar_id":"","url":"https://api.github.com/users/johnjbarton","html_url":"https://github.com/johnjbarton","followers_url":"https://api.github.com/users/johnjbarton/followers","following_url":"https://api.github.com/users/johnjbarton/following{/other_user}","gists_url":"https://api.github.com/users/johnjbarton/gists{/gist_id}","starred_url":"https://api.github.com/users/johnjbarton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnjbarton/subscriptions","organizations_url":"https://api.github.com/users/johnjbarton/orgs","repos_url":"https://api.github.com/users/johnjbarton/repos","events_url":"https://api.github.com/users/johnjbarton/events{/privacy}","received_events_url":"https://api.github.com/users/johnjbarton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"johnjbarton","id":205570,"avatar_url":"https://avatars.githubusercontent.com/u/205570?v=3","gravatar_id":"","url":"https://api.github.com/users/johnjbarton","html_url":"https://github.com/johnjbarton","followers_url":"https://api.github.com/users/johnjbarton/followers","following_url":"https://api.github.com/users/johnjbarton/following{/other_user}","gists_url":"https://api.github.com/users/johnjbarton/gists{/gist_id}","starred_url":"https://api.github.com/users/johnjbarton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnjbarton/subscriptions","organizations_url":"https://api.github.com/users/johnjbarton/orgs","repos_url":"https://api.github.com/users/johnjbarton/repos","events_url":"https://api.github.com/users/johnjbarton/events{/privacy}","received_events_url":"https://api.github.com/users/johnjbarton/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-11-11T16:06:34Z","updated_at":"2015-11-13T16:11:37Z","closed_at":null,"body":"Given two modules:\r\n```js\r\nimport {x} from './reexport-x.js';\r\nthis.result = x;  // To verify execution, test this global value.\r\n```\r\nand\r\n```js\r\n// Combine with import-x.js to test InlineES6ModuleTransformer\r\nimport {x} from './reexport-x.js';\r\nexport var y = x;\r\n```\r\nThe compilation with options `--modules=inline --outputLanguage=es6` will fail with\r\n```\r\nDuplicate declaration, x\r\n```\r\nThe generated code is \r\n```js\r\nconst $__test_47_unit_47_node_47_resources_47_x_46_js__ = (function() {\r\n  \"use strict\";\r\n  var x = 'x';\r\n  return {get x() {\r\n      return x;\r\n    }};\r\n})();\r\nconst $__test_47_unit_47_node_47_resources_47_reexport_45_x_46_js__ = (function() {\r\n  \"use strict\";\r\n  return {get x() {\r\n      return $__test_47_unit_47_node_47_resources_47_x_46_js__.x;\r\n    }};\r\n})();\r\n\"use strict\";\r\nconst {x} = $__test_47_unit_47_node_47_resources_47_reexport_45_x_46_js__;\r\nthis.result = x;\r\n\"use strict\";\r\nconst {x} = $__test_47_unit_47_node_47_resources_47_reexport_45_x_46_js__;\r\nexport var y = x;\r\n```\r\nThe problem is that the names in the ModuleSpecifierSet are not renamed:\r\nhttps://github.com/google/traceur-compiler/blob/master/src/codegeneration/InlineES6ModuleTransformer.js#L132"},"comment":{"url":"https://api.github.com/repos/google/traceur-compiler/issues/comments/156475736","html_url":"https://github.com/google/traceur-compiler/issues/2005#issuecomment-156475736","issue_url":"https://api.github.com/repos/google/traceur-compiler/issues/2005","id":156475736,"user":{"login":"johnjbarton","id":205570,"avatar_url":"https://avatars.githubusercontent.com/u/205570?v=3","gravatar_id":"","url":"https://api.github.com/users/johnjbarton","html_url":"https://github.com/johnjbarton","followers_url":"https://api.github.com/users/johnjbarton/followers","following_url":"https://api.github.com/users/johnjbarton/following{/other_user}","gists_url":"https://api.github.com/users/johnjbarton/gists{/gist_id}","starred_url":"https://api.github.com/users/johnjbarton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnjbarton/subscriptions","organizations_url":"https://api.github.com/users/johnjbarton/orgs","repos_url":"https://api.github.com/users/johnjbarton/repos","events_url":"https://api.github.com/users/johnjbarton/events{/privacy}","received_events_url":"https://api.github.com/users/johnjbarton/received_events","type":"User","site_admin":false},"created_at":"2015-11-13T16:11:37Z","updated_at":"2015-11-13T16:11:37Z","body":"I don't see how that would help: the result of the `--modules=inline` will be one file including the two modules and the import-as code. The problem comes from the two modules: their code has to be rewritten to replace `{x}` with `{x as x1}` to ensure that the generated code does not redeclare `x`.  I can try that in our code."}}