{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12761","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12761/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12761/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12761/events","html_url":"https://github.com/Microsoft/TypeScript/issues/12761","id":194333270,"number":12761,"title":"Can't compare property value other than 2, because of previously developed \"if != 2 then error\" code","user":{"login":"ymoradi","id":5352980,"avatar_url":"https://avatars.githubusercontent.com/u/5352980?v=3","gravatar_id":"","url":"https://api.github.com/users/ymoradi","html_url":"https://github.com/ymoradi","followers_url":"https://api.github.com/users/ymoradi/followers","following_url":"https://api.github.com/users/ymoradi/following{/other_user}","gists_url":"https://api.github.com/users/ymoradi/gists{/gist_id}","starred_url":"https://api.github.com/users/ymoradi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ymoradi/subscriptions","organizations_url":"https://api.github.com/users/ymoradi/orgs","repos_url":"https://api.github.com/users/ymoradi/repos","events_url":"https://api.github.com/users/ymoradi/events{/privacy}","received_events_url":"https://api.github.com/users/ymoradi/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":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2016-12-08T13:16:52Z","updated_at":"2016-12-08T19:02:47Z","closed_at":"2016-12-08T18:11:52Z","body":"Can't compare property value other than 2, because of previously developed \"if != 2 then error\" code\r\n\r\n            if (vm.model.Id != '2')\r\n                throw new Error(\"...\");\r\n            // some codes ...\r\n            if (vm.model.Id != '1')\r\n                throw new Error(\"...\");\r\n\r\nvm: { model : { Id : string; } }\r\n\r\n```\r\n\"compilerOptions\": {\r\n    \"allowUnreachableCode\": true,\r\n    \"declaration\": true,\r\n    \"emitDecoratorMetadata\": false,\r\n    \"experimentalDecorators\": true,\r\n    \"module\": \"none\",\r\n    \"outFile\": \"test.js\",\r\n    \"target\": \"es5\",\r\n    \"sourceMap\": true,\r\n    \"lib\": [ \"dom\", \"es2015\" ]\r\n  }\r\n\r\n```\r\nTypeScript 2.1.4 | Visual Studio 2015 Update 3\r\n\r\n**Actual behavior:**\r\nError: Operator '!=' cannot be applied to types '\"2\"' and '\"1\"'.\r\n\r\nIs there any config to disable this behavior? I know why this is happening, but I'm not interested in this type of flow checking in typescript."},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/265824779","html_url":"https://github.com/Microsoft/TypeScript/issues/12761#issuecomment-265824779","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12761","id":265824779,"user":{"login":"fedoranimus","id":179260,"avatar_url":"https://avatars.githubusercontent.com/u/179260?v=3","gravatar_id":"","url":"https://api.github.com/users/fedoranimus","html_url":"https://github.com/fedoranimus","followers_url":"https://api.github.com/users/fedoranimus/followers","following_url":"https://api.github.com/users/fedoranimus/following{/other_user}","gists_url":"https://api.github.com/users/fedoranimus/gists{/gist_id}","starred_url":"https://api.github.com/users/fedoranimus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedoranimus/subscriptions","organizations_url":"https://api.github.com/users/fedoranimus/orgs","repos_url":"https://api.github.com/users/fedoranimus/repos","events_url":"https://api.github.com/users/fedoranimus/events{/privacy}","received_events_url":"https://api.github.com/users/fedoranimus/received_events","type":"User","site_admin":false},"created_at":"2016-12-08T19:02:47Z","updated_at":"2016-12-08T19:02:47Z","body":"> This logic has found multiple bugs in existing well-tested codebases. It's a good trade-off vs just allowing nonsense code for the sake of allowing it.\r\n\r\nOkay, I can empathize with this position."}}
{"actor":{"display_login":"fedoranimus"}}