{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3590","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3590/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3590/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3590/events","html_url":"https://github.com/Microsoft/TypeScript/issues/3590","id":89968305,"number":3590,"title":"generate-diagnostics collision handling chokes if two or more collisions are markde \"fixed\"","user":{"login":"colbyrussell","id":10376674,"avatar_url":"https://avatars.githubusercontent.com/u/10376674?v=3","gravatar_id":"","url":"https://api.github.com/users/colbyrussell","html_url":"https://github.com/colbyrussell","followers_url":"https://api.github.com/users/colbyrussell/followers","following_url":"https://api.github.com/users/colbyrussell/following{/other_user}","gists_url":"https://api.github.com/users/colbyrussell/gists{/gist_id}","starred_url":"https://api.github.com/users/colbyrussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colbyrussell/subscriptions","organizations_url":"https://api.github.com/users/colbyrussell/orgs","repos_url":"https://api.github.com/users/colbyrussell/repos","events_url":"https://api.github.com/users/colbyrussell/events{/privacy}","received_events_url":"https://api.github.com/users/colbyrussell/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Accepting%20PRs","name":"Accepting PRs","color":"009800"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Suggestion","name":"Suggestion","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/2","html_url":"https://github.com/Microsoft/TypeScript/milestones/Community","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/2/labels","id":721044,"number":2,"title":"Community","description":"Issues in the 'Community' milestone are ones which we are accepting pull requests for","creator":{"login":"RyanCavanaugh","id":6685088,"avatar_url":"https://avatars.githubusercontent.com/u/6685088?v=3","gravatar_id":"","url":"https://api.github.com/users/RyanCavanaugh","html_url":"https://github.com/RyanCavanaugh","followers_url":"https://api.github.com/users/RyanCavanaugh/followers","following_url":"https://api.github.com/users/RyanCavanaugh/following{/other_user}","gists_url":"https://api.github.com/users/RyanCavanaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanCavanaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanCavanaugh/subscriptions","organizations_url":"https://api.github.com/users/RyanCavanaugh/orgs","repos_url":"https://api.github.com/users/RyanCavanaugh/repos","events_url":"https://api.github.com/users/RyanCavanaugh/events{/privacy}","received_events_url":"https://api.github.com/users/RyanCavanaugh/received_events","type":"User","site_admin":false},"open_issues":94,"closed_issues":35,"state":"open","created_at":"2014-07-14T23:24:58Z","updated_at":"2015-06-23T20:27:55Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-06-21T22:24:48Z","updated_at":"2015-06-23T22:02:26Z","closed_at":null,"body":"The problem:\r\n\r\nIf `handleCollisions` finds two collisions that are both marked \"fixed\" (in the `isFixed` array), it silently allows both names to escape unaltered and leaving the collisions intact:\r\n\r\n```\r\n        for (var i = 0; i < collisionIndices.length; i++) {\r\n            var collisionIndex = collisionIndices[i];\r\n\r\n            if (isFixed[collisionIndex]) {\r\n                // can't do anything about this name.\r\n                continue;\r\n            }\r\n```\r\n\r\nThe code for handling `isFixed` and `isCaseSensitive` is dead code, so there's no way to trigger this problem, even with alternative input.  All names are treated as if they're not fixed, so it's completely unused.  Even so, we go through some effort to generate an n-sized array for the `isFixed` part:\r\n\r\n```\r\n        if (!isFixed) {\r\n            isFixed = names.map(() => false)\r\n        }\r\n```\r\n\r\nIt seems like these snippets may have been copied and pasted (or cross-language ported) from another project.\r\n\r\nProposed solution:\r\n\r\nRemove the `isFixed`-handling from processDiagnosticsMessages.ts altogether.  This would obviate the problem.  We could do the same with `isCaseSensitive` while we're at it."},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/114654710","html_url":"https://github.com/Microsoft/TypeScript/issues/3590#issuecomment-114654710","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3590","id":114654710,"user":{"login":"colbyrussell","id":10376674,"avatar_url":"https://avatars.githubusercontent.com/u/10376674?v=3","gravatar_id":"","url":"https://api.github.com/users/colbyrussell","html_url":"https://github.com/colbyrussell","followers_url":"https://api.github.com/users/colbyrussell/followers","following_url":"https://api.github.com/users/colbyrussell/following{/other_user}","gists_url":"https://api.github.com/users/colbyrussell/gists{/gist_id}","starred_url":"https://api.github.com/users/colbyrussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colbyrussell/subscriptions","organizations_url":"https://api.github.com/users/colbyrussell/orgs","repos_url":"https://api.github.com/users/colbyrussell/repos","events_url":"https://api.github.com/users/colbyrussell/events{/privacy}","received_events_url":"https://api.github.com/users/colbyrussell/received_events","type":"User","site_admin":false},"created_at":"2015-06-23T22:02:26Z","updated_at":"2015-06-23T22:02:26Z","body":"In light of the previous comment, this should be marked WONTFIX and closed, instead of \"Accepting PRs\", no?"}}