{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/152693231","pull_request_review_id":78594711,"id":152693231,"diff_hunk":"@@ -115,33 +115,119 @@ public static void Analyze(CSharpCompilation compilation, Symbol member, BoundNo\n \n         protected override void Normalize(ref LocalState state)\n         {\n+            int oldNext = state.Capacity;\n             state.EnsureCapacity(nextVariableSlot);\n+            for (int slot = oldNext; slot < nextVariableSlot; slot++)\n+            {\n+                var value = !GetDefaultState(ref state, slot);\n+                state[slot] = value;\n+            }\n+        }\n+\n+        private bool? GetDefaultState(ref LocalState state, int slot)\n+        {\n+            if (slot == 0)\n+            {\n+                return null;\n+            }\n+\n+            var variable = variableBySlot[slot];\n+            var symbol = variable.Symbol;\n+\n+            switch (symbol.Kind)\n+            {\n+                case SymbolKind.Local:\n+                    return null;\n+                case SymbolKind.Parameter:\n+                    {\n+                        var parameter = (ParameterSymbol)symbol;\n+                        return (parameter.RefKind == RefKind.Out) ?\n+                            null :\n+                            parameter.Type.IsNullable;\n+                    }\n+                case SymbolKind.Field:\n+                case SymbolKind.Property:\n+                    return !IsContainerAssigned(ref state, variable.ContainingSlot) ?\n+                        null :\n+                        symbol.GetTypeOrReturnType().IsNullable;\n+                default:\n+                    throw ExceptionUtilities.UnexpectedValue(symbol.Kind);\n+            }\n+        }\n+\n+        private bool IsContainerAssigned(ref LocalState state, int containingSlot)\n+        {\n+            var variable = variableBySlot[containingSlot];\n+            var containingSymbol = variable.Symbol;\n+            var containingType = containingSymbol.GetTypeOrReturnType();\n+            if (containingType.TypeKind == TypeKind.Class && (object)containingSymbol == MethodThisParameter)\n+            {\n+                return true;\n+            }\n+            var isNotNull = state[containingSlot];\n+            return isNotNull != null;","path":"src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs","position":72,"original_position":72,"commit_id":"193a43753f1ef33ab9716a417b83f311e68eb97b","original_commit_id":"193a43753f1ef33ab9716a417b83f311e68eb97b","user":{"login":"AlekseyTs","id":10522107,"avatar_url":"https://avatars0.githubusercontent.com/u/10522107?v=4","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},"body":">return isNotNull != null; [](start = 12, length = 25)\r\n\r\nThis feels fragile because the state doesn't really track assigned state. Potentially we could be in a situation when we simply don't know if the container is null, or simply would like to suppress warnings for it. ","created_at":"2017-11-22T22:32:05Z","updated_at":"2017-11-22T22:32:05Z","html_url":"https://github.com/dotnet/roslyn/pull/23063#discussion_r152693231","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/23063","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/152693231"},"html":{"href":"https://github.com/dotnet/roslyn/pull/23063#discussion_r152693231"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/23063"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/23063","id":151263339,"html_url":"https://github.com/dotnet/roslyn/pull/23063","diff_url":"https://github.com/dotnet/roslyn/pull/23063.diff","patch_url":"https://github.com/dotnet/roslyn/pull/23063.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/23063","number":23063,"state":"open","locked":false,"title":"Track dotted members in nullable flow analysis","user":{"login":"cston","id":10732005,"avatar_url":"https://avatars2.githubusercontent.com/u/10732005?v=4","gravatar_id":"","url":"https://api.github.com/users/cston","html_url":"https://github.com/cston","followers_url":"https://api.github.com/users/cston/followers","following_url":"https://api.github.com/users/cston/following{/other_user}","gists_url":"https://api.github.com/users/cston/gists{/gist_id}","starred_url":"https://api.github.com/users/cston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cston/subscriptions","organizations_url":"https://api.github.com/users/cston/orgs","repos_url":"https://api.github.com/users/cston/repos","events_url":"https://api.github.com/users/cston/events{/privacy}","received_events_url":"https://api.github.com/users/cston/received_events","type":"User","site_admin":false},"body":"\r\n","created_at":"2017-11-08T00:20:08Z","updated_at":"2017-11-22T22:32:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"32dc0e70fefeb8e840431387d881cca9c16792cf","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/23063/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/23063/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/23063/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/193a43753f1ef33ab9716a417b83f311e68eb97b","head":{"label":"cston:members","ref":"members","sha":"193a43753f1ef33ab9716a417b83f311e68eb97b","user":{"login":"cston","id":10732005,"avatar_url":"https://avatars2.githubusercontent.com/u/10732005?v=4","gravatar_id":"","url":"https://api.github.com/users/cston","html_url":"https://github.com/cston","followers_url":"https://api.github.com/users/cston/followers","following_url":"https://api.github.com/users/cston/following{/other_user}","gists_url":"https://api.github.com/users/cston/gists{/gist_id}","starred_url":"https://api.github.com/users/cston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cston/subscriptions","organizations_url":"https://api.github.com/users/cston/orgs","repos_url":"https://api.github.com/users/cston/repos","events_url":"https://api.github.com/users/cston/events{/privacy}","received_events_url":"https://api.github.com/users/cston/received_events","type":"User","site_admin":false},"repo":{"id":30556803,"name":"roslyn","full_name":"cston/roslyn","owner":{"login":"cston","id":10732005,"avatar_url":"https://avatars2.githubusercontent.com/u/10732005?v=4","gravatar_id":"","url":"https://api.github.com/users/cston","html_url":"https://github.com/cston","followers_url":"https://api.github.com/users/cston/followers","following_url":"https://api.github.com/users/cston/following{/other_user}","gists_url":"https://api.github.com/users/cston/gists{/gist_id}","starred_url":"https://api.github.com/users/cston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cston/subscriptions","organizations_url":"https://api.github.com/users/cston/orgs","repos_url":"https://api.github.com/users/cston/repos","events_url":"https://api.github.com/users/cston/events{/privacy}","received_events_url":"https://api.github.com/users/cston/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cston/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":true,"url":"https://api.github.com/repos/cston/roslyn","forks_url":"https://api.github.com/repos/cston/roslyn/forks","keys_url":"https://api.github.com/repos/cston/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cston/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cston/roslyn/teams","hooks_url":"https://api.github.com/repos/cston/roslyn/hooks","issue_events_url":"https://api.github.com/repos/cston/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/cston/roslyn/events","assignees_url":"https://api.github.com/repos/cston/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/cston/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/cston/roslyn/tags","blobs_url":"https://api.github.com/repos/cston/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cston/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cston/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/cston/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cston/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/cston/roslyn/languages","stargazers_url":"https://api.github.com/repos/cston/roslyn/stargazers","contributors_url":"https://api.github.com/repos/cston/roslyn/contributors","subscribers_url":"https://api.github.com/repos/cston/roslyn/subscribers","subscription_url":"https://api.github.com/repos/cston/roslyn/subscription","commits_url":"https://api.github.com/repos/cston/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/cston/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/cston/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/cston/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/cston/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/cston/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cston/roslyn/merges","archive_url":"https://api.github.com/repos/cston/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cston/roslyn/downloads","issues_url":"https://api.github.com/repos/cston/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/cston/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/cston/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/cston/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cston/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/cston/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/cston/roslyn/deployments","created_at":"2015-02-09T20:26:55Z","updated_at":"2016-01-14T20:03:36Z","pushed_at":"2017-11-22T07:53:39Z","git_url":"git://github.com/cston/roslyn.git","ssh_url":"git@github.com:cston/roslyn.git","clone_url":"https://github.com/cston/roslyn.git","svn_url":"https://github.com/cston/roslyn","homepage":"","size":248150,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:features/NullableReferenceTypes","ref":"features/NullableReferenceTypes","sha":"be7c067f0607238e9b63ceee131c74ccafb2bd3d","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":29078997,"name":"roslyn","full_name":"dotnet/roslyn","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":false,"url":"https://api.github.com/repos/dotnet/roslyn","forks_url":"https://api.github.com/repos/dotnet/roslyn/forks","keys_url":"https://api.github.com/repos/dotnet/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/roslyn/teams","hooks_url":"https://api.github.com/repos/dotnet/roslyn/hooks","issue_events_url":"https://api.github.com/repos/dotnet/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/roslyn/events","assignees_url":"https://api.github.com/repos/dotnet/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/roslyn/tags","blobs_url":"https://api.github.com/repos/dotnet/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/roslyn/languages","stargazers_url":"https://api.github.com/repos/dotnet/roslyn/stargazers","contributors_url":"https://api.github.com/repos/dotnet/roslyn/contributors","subscribers_url":"https://api.github.com/repos/dotnet/roslyn/subscribers","subscription_url":"https://api.github.com/repos/dotnet/roslyn/subscription","commits_url":"https://api.github.com/repos/dotnet/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/roslyn/merges","archive_url":"https://api.github.com/repos/dotnet/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/roslyn/downloads","issues_url":"https://api.github.com/repos/dotnet/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/roslyn/deployments","created_at":"2015-01-11T02:39:03Z","updated_at":"2017-11-22T22:13:18Z","pushed_at":"2017-11-22T22:21:27Z","git_url":"git://github.com/dotnet/roslyn.git","ssh_url":"git@github.com:dotnet/roslyn.git","clone_url":"https://github.com/dotnet/roslyn.git","svn_url":"https://github.com/dotnet/roslyn","homepage":"","size":255591,"stargazers_count":8458,"watchers_count":8458,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2048,"mirror_url":null,"archived":false,"open_issues_count":4126,"forks":2048,"open_issues":4126,"watchers":8458,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/23063"},"html":{"href":"https://github.com/dotnet/roslyn/pull/23063"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/23063"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/23063/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/23063/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/23063/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/193a43753f1ef33ab9716a417b83f311e68eb97b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"AlekseyTs"}}