{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/20642","repository_url":"https://api.github.com/repos/dotnet/roslyn","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/20642/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/20642/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/20642/events","html_url":"https://github.com/dotnet/roslyn/issues/20642","id":240681348,"number":20642,"title":"[Compilers] Generated IL for is check against constant","user":{"login":"Therzok","id":109974,"avatar_url":"https://avatars1.githubusercontent.com/u/109974?v=4","gravatar_id":"","url":"https://api.github.com/users/Therzok","html_url":"https://github.com/Therzok","followers_url":"https://api.github.com/users/Therzok/followers","following_url":"https://api.github.com/users/Therzok/following{/other_user}","gists_url":"https://api.github.com/users/Therzok/gists{/gist_id}","starred_url":"https://api.github.com/users/Therzok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Therzok/subscriptions","organizations_url":"https://api.github.com/users/Therzok/orgs","repos_url":"https://api.github.com/users/Therzok/repos","events_url":"https://api.github.com/users/Therzok/events{/privacy}","received_events_url":"https://api.github.com/users/Therzok/received_events","type":"User","site_admin":false},"labels":[{"id":166673288,"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Compilers","name":"Area-Compilers","color":"5319e7","default":false},{"id":165001069,"url":"https://api.github.com/repos/dotnet/roslyn/labels/Bug","name":"Bug","color":"e52727","default":false},{"id":326633537,"url":"https://api.github.com/repos/dotnet/roslyn/labels/New%20Language%20Feature%20-%20Pattern%20Matching","name":"New Language Feature - Pattern Matching","color":"bfd4f2","default":false},{"id":166680397,"url":"https://api.github.com/repos/dotnet/roslyn/labels/Tenet-Performance","name":"Tenet-Performance","color":"c4531b","default":false}],"state":"closed","locked":false,"assignee":{"login":"gafter","id":3804346,"avatar_url":"https://avatars3.githubusercontent.com/u/3804346?v=4","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},"assignees":[{"login":"gafter","id":3804346,"avatar_url":"https://avatars3.githubusercontent.com/u/3804346?v=4","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/dotnet/roslyn/milestones/18","html_url":"https://github.com/dotnet/roslyn/milestone/18","labels_url":"https://api.github.com/repos/dotnet/roslyn/milestones/18/labels","id":1675130,"number":18,"title":"16.0","description":"The version *after* the next major version.","creator":{"login":"gafter","id":3804346,"avatar_url":"https://avatars3.githubusercontent.com/u/3804346?v=4","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},"open_issues":621,"closed_issues":111,"state":"open","created_at":"2016-03-31T00:06:25Z","updated_at":"2018-03-18T00:08:12Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2017-07-05T15:03:34Z","updated_at":"2018-03-18T00:08:12Z","closed_at":"2018-03-18T00:08:12Z","author_association":"CONTRIBUTOR","body":"**Version Used**: \r\nd8c89de9bf165693a92f31bcef036bebd031780f\r\n\r\n**Steps to Reproduce**:\r\n\r\n1. Check the code/IL gen here https://gist.github.com/Therzok/6562398fb9a1fe87b407bda9d1c6a3db\r\n2. Or here: https://sharplab.io/#v2:EYLgtghgzgLgpgJwDQxASwDYB8ACAGAAhwEYBuAWACh8jiA6AJQFcA7GNMOOgSTcQHsADgGVEANzQBjOFAqUqOAEwEAshDQsAwhmhQqAbyoECk/i1gENMAmACep89YC8BAKxzjsCO0lEALKrqLAAUJHgA2gC6BBAIAOZQAJRGBIaUAJDpVgQAHgQuAMxymWgAZgTBeWhQNvZmsImpVFSZAL4p7ZSdQA=\r\n3. See that the generated IL is inefficient\r\n\r\n**Expected Behavior**:\r\nIf a value type implements IEquatable<T>, I'd assume that `IEquatable<T>.Equals (T other)` would be used on the left expression with the right expression as a parameter. This could be done via `EqualityComparer<T>.Default.Equals (T a, T b)`\r\n\r\n**Actual Behavior**:\r\n`object.Equals(object, object)` is being used, which leads to inefficient code when using value types.\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/373962315","html_url":"https://github.com/dotnet/roslyn/issues/20642#issuecomment-373962315","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/20642","id":373962315,"user":{"login":"gafter","id":3804346,"avatar_url":"https://avatars3.githubusercontent.com/u/3804346?v=4","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},"created_at":"2018-03-18T00:08:12Z","updated_at":"2018-03-18T00:08:12Z","author_association":"MEMBER","body":"Closing as a dup of #12813"}}
{"actor":{"display_login":"gafter"}}