{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/10155","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/10155/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/10155/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/10155/events","html_url":"https://github.com/Microsoft/TypeScript/issues/10155","id":169478356,"number":10155,"title":"Disallowing certain operators on a custom type","user":{"login":"d180cf","id":13122495,"avatar_url":"https://avatars.githubusercontent.com/u/13122495?v=3","gravatar_id":"","url":"https://api.github.com/users/d180cf","html_url":"https://github.com/d180cf","followers_url":"https://api.github.com/users/d180cf/followers","following_url":"https://api.github.com/users/d180cf/following{/other_user}","gists_url":"https://api.github.com/users/d180cf/gists{/gist_id}","starred_url":"https://api.github.com/users/d180cf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d180cf/subscriptions","organizations_url":"https://api.github.com/users/d180cf/orgs","repos_url":"https://api.github.com/users/d180cf/repos","events_url":"https://api.github.com/users/d180cf/events{/privacy}","received_events_url":"https://api.github.com/users/d180cf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-08-04T21:31:07Z","updated_at":"2016-09-30T00:03:25Z","closed_at":"2016-09-30T00:03:25Z","body":"In general, tsc allows all the operators on any types, except certain specific cases, like `a + b` where `a` and `b` are boolean values. There are cases when disabling certain operators the same way would be useful:\r\n\r\n```ts\r\n// js doesn't have 64 bit numbers,\r\n// so here is a clumsy workaround\r\ninterface int64 {\r\n  [0]: number;\r\n  [1]: number;\r\n}\r\n\r\nconst a: int64 = ...;\r\nconst b: int64 = ...;\r\n\r\nif (a == b) {\r\n  ...\r\n}\r\n```\r\n\r\nThe `a == b` check is a mistake that will be hard to catch later. It would be nice to disable the `==` operator (as well as others) for this `int64` type.\r\n\r\n"}}
{"actor":{"display_login":"mhegazy"}}