{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/9980","repository_url":"https://api.github.com/repos/dotnet/roslyn","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/9980/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/9980/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/9980/events","html_url":"https://github.com/dotnet/roslyn/issues/9980","id":142796537,"number":9980,"title":"Nullable reference types: No unreachable warning for null check on not-nullable variable","user":{"login":"bkoelman","id":10324372,"avatar_url":"https://avatars.githubusercontent.com/u/10324372?v=3","gravatar_id":"","url":"https://api.github.com/users/bkoelman","html_url":"https://github.com/bkoelman","followers_url":"https://api.github.com/users/bkoelman/followers","following_url":"https://api.github.com/users/bkoelman/following{/other_user}","gists_url":"https://api.github.com/users/bkoelman/gists{/gist_id}","starred_url":"https://api.github.com/users/bkoelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkoelman/subscriptions","organizations_url":"https://api.github.com/users/bkoelman/orgs","repos_url":"https://api.github.com/users/bkoelman/repos","events_url":"https://api.github.com/users/bkoelman/events{/privacy}","received_events_url":"https://api.github.com/users/bkoelman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Compilers","name":"Area-Compilers","color":"5319e7"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Language-C%23","name":"Language-C#","color":"207de5"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Need%20More%20Info","name":"Need More Info","color":"fbca04"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/New%20Language%20Feature%20-%20Nullable%20Reference%20Types","name":"New Language Feature - Nullable Reference Types","color":"bfd4f2"}],"state":"open","locked":false,"assignee":{"login":"AlekseyTs","id":10522107,"avatar_url":"https://avatars.githubusercontent.com/u/10522107?v=3","gravatar_id":"","url":"https://api.github.com/users/AlekseyTs","html_url":"https://github.com/AlekseyTs","followers_url":"https://api.github.com/users/AlekseyTs/followers","following_url":"https://api.github.com/users/AlekseyTs/following{/other_user}","gists_url":"https://api.github.com/users/AlekseyTs/gists{/gist_id}","starred_url":"https://api.github.com/users/AlekseyTs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlekseyTs/subscriptions","organizations_url":"https://api.github.com/users/AlekseyTs/orgs","repos_url":"https://api.github.com/users/AlekseyTs/repos","events_url":"https://api.github.com/users/AlekseyTs/events{/privacy}","received_events_url":"https://api.github.com/users/AlekseyTs/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2016-03-22T22:14:28Z","updated_at":"2016-03-22T22:32:19Z","closed_at":null,"body":"I have been playing with nullable reference types, which is already working remarkably great! To try it out, I have [patched up](https://github.com/bkoelman/ResharperCodeContractNullability/tree/staticnull) my analyzer to convert Resharper's `(Item)NotNull/CanBeNullAttribute` annotations to nullable reference types. Then ran that on an [actual annotated codebase](https://github.com/bkoelman/DogAgilityCompetitionManagement). \r\n\r\nDuring that process I discovered some oddities, which I'll create issues for here.\r\n\r\n**Version Used**: Built from source, branch NullableReferenceTypes (commit https://github.com/dotnet/roslyn/commit/8553cdac75c2b0901e8ae401aaa23022f0689935)\r\n\r\n**Steps to Reproduce**:\r\nThe next block of code does not raise any warnings:\r\n\r\n```csharp\r\nvoid Test()\r\n{\r\n    const string s = \"x\";\r\n\r\n    if (s == null)\r\n    {\r\n        throw new Exception();\r\n    }\r\n}\r\n```\r\n\r\n**Expected Behavior**: A warning that indicates the null check will never evaluate to `true`; possibly reuse [CS0472](https://msdn.microsoft.com/en-us/library/ms228621(v=vs.90).aspx). Followed by [CS0162](https://msdn.microsoft.com/en-us/library/c0h4st1x.aspx), which indicates the `throw` line is unreachable.\r\n\r\n**Actual Behavior**:\r\nNo warnings.\r\n\r\n@AlekseyTs "},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/200062566","html_url":"https://github.com/dotnet/roslyn/issues/9980#issuecomment-200062566","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/9980","id":200062566,"user":{"login":"bkoelman","id":10324372,"avatar_url":"https://avatars.githubusercontent.com/u/10324372?v=3","gravatar_id":"","url":"https://api.github.com/users/bkoelman","html_url":"https://github.com/bkoelman","followers_url":"https://api.github.com/users/bkoelman/followers","following_url":"https://api.github.com/users/bkoelman/following{/other_user}","gists_url":"https://api.github.com/users/bkoelman/gists{/gist_id}","starred_url":"https://api.github.com/users/bkoelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkoelman/subscriptions","organizations_url":"https://api.github.com/users/bkoelman/orgs","repos_url":"https://api.github.com/users/bkoelman/repos","events_url":"https://api.github.com/users/bkoelman/events{/privacy}","received_events_url":"https://api.github.com/users/bkoelman/received_events","type":"User","site_admin":false},"created_at":"2016-03-22T22:32:19Z","updated_at":"2016-03-22T22:32:19Z","body":"This is what I get (running in VS2015 Update1):\r\n\r\n![image](https://cloud.githubusercontent.com/assets/10324372/13969975/35852396-f086-11e5-91dd-d97df9f012d1.png)\r\n"}}