{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/213850327","pull_request_review_id":150774010,"id":213850327,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMzg1MDMyNw==","diff_hunk":"@@ -454,9 +444,43 @@ internal bool IsReferenceTypeFromConstraintTypes(ImmutableArray<TypeSymbolWithAn\n             return AnyConstraintTypes(constraintTypes, inProgress, (type, arg) => ConstraintImpliesReferenceType(type.TypeSymbol, arg));\n         }\n \n-        internal bool IsNotNullableIfReferenceTypeFromConstraintTypes(ImmutableArray<TypeSymbolWithAnnotations> constraintTypes, ConsList<TypeParameterSymbol> inProgress)\n+        internal bool? IsNotNullableIfReferenceTypeFromConstraintTypes(ImmutableArray<TypeSymbolWithAnnotations> constraintTypes, ConsList<TypeParameterSymbol> inProgress)\n         {\n-            return AnyConstraintTypes(constraintTypes, inProgress, (type, arg) => ConstraintImpliesIsNotNullableIfReferenceType(type, arg));\n+            Debug.Assert(!constraintTypes.IsDefaultOrEmpty);\n+            inProgress = inProgress.Prepend(this);\n+\n+            bool? result = false;\n+            foreach (TypeSymbolWithAnnotations constraintType in constraintTypes)\n+            {\n+                if (constraintType.IsAnnotated)\n+                {\n+                    continue;\n+                }\n+\n+                if (constraintType.TypeKind == TypeKind.TypeParameter)\n+                {\n+                    bool? isNotNullableIfReferenceType = ((TypeParameterSymbol)constraintType.TypeSymbol).GetIsNotNullableIfReferenceType(inProgress);\n+\n+                    if (isNotNullableIfReferenceType == false)\n+                    {\n+                        continue;\n+                    }\n+                    else if (isNotNullableIfReferenceType == null)\n+                    {\n+                        result = null;\n+                        continue;\n+                    }\n+                }\n+\n+                if (constraintType.NonNullTypesContext.NonNullTypes == true)","path":"src/Compilers/CSharp/Portable/Symbols/TypeParameterSymbol.cs","position":60,"original_position":60,"commit_id":"650bdaf79ab1e4e380b6d191045cd8bf84d15926","original_commit_id":"650bdaf79ab1e4e380b6d191045cd8bf84d15926","user":{"login":"AlekseyTs","id":10522107,"node_id":"MDQ6VXNlcjEwNTIyMTA3","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":"> I found this surprising. The NonNullTypes context of the constraint type doesn't seem relevant.\r\n\r\nIf context of the constraint type is not relevant, then why do we have it in TypeSymbolWithAnnotations?\r\n\r\n>  I would have thought that the context of the member declaring those constraints would come into play instead.\r\n\r\nIsn't that what is getting captured in TypeSymbolWithAnnotations.NonNullTypesContext? We are interested in context that was in play when the type reference was bound, whether at constraint declaration site, or at generic construction site.\r\n\r\n---\r\nIn reply to: [213848658](https://github.com/dotnet/roslyn/pull/29586#discussion_r213848658) [](ancestors = 213848658)","created_at":"2018-08-29T22:07:55Z","updated_at":"2018-08-29T22:07:55Z","html_url":"https://github.com/dotnet/roslyn/pull/29586#discussion_r213850327","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/29586","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/213850327"},"html":{"href":"https://github.com/dotnet/roslyn/pull/29586#discussion_r213850327"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/29586"}},"in_reply_to_id":213848658},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/29586","id":211874234,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExODc0MjM0","html_url":"https://github.com/dotnet/roslyn/pull/29586","diff_url":"https://github.com/dotnet/roslyn/pull/29586.diff","patch_url":"https://github.com/dotnet/roslyn/pull/29586.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/29586","number":29586,"state":"open","locked":false,"title":"Handle interaction between ‘class’ constraint and NonNullTypes context.","user":{"login":"AlekseyTs","id":10522107,"node_id":"MDQ6VXNlcjEwNTIyMTA3","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":"Also implemented detection of nullability mismatch in constraints for an implicit interface implementation.","created_at":"2018-08-29T20:16:45Z","updated_at":"2018-08-29T22:07:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ae7b8ab2cfda0c86375f518b86bdd9a0d6bcd035","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":166673288,"node_id":"MDU6TGFiZWwxNjY2NzMyODg=","url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Compilers","name":"Area-Compilers","color":"5319e7","default":false},{"id":344899605,"node_id":"MDU6TGFiZWwzNDQ4OTk2MDU=","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","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/29586/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/29586/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/29586/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/650bdaf79ab1e4e380b6d191045cd8bf84d15926","head":{"label":"AlekseyTs:ClassConstraintAndNonNullTypesContext","ref":"ClassConstraintAndNonNullTypesContext","sha":"650bdaf79ab1e4e380b6d191045cd8bf84d15926","user":{"login":"AlekseyTs","id":10522107,"node_id":"MDQ6VXNlcjEwNTIyMTA3","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},"repo":{"id":32701567,"node_id":"MDEwOlJlcG9zaXRvcnkzMjcwMTU2Nw==","name":"roslyn","full_name":"AlekseyTs/roslyn","owner":{"login":"AlekseyTs","id":10522107,"node_id":"MDQ6VXNlcjEwNTIyMTA3","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},"private":false,"html_url":"https://github.com/AlekseyTs/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/AlekseyTs/roslyn","forks_url":"https://api.github.com/repos/AlekseyTs/roslyn/forks","keys_url":"https://api.github.com/repos/AlekseyTs/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlekseyTs/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlekseyTs/roslyn/teams","hooks_url":"https://api.github.com/repos/AlekseyTs/roslyn/hooks","issue_events_url":"https://api.github.com/repos/AlekseyTs/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/AlekseyTs/roslyn/events","assignees_url":"https://api.github.com/repos/AlekseyTs/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/AlekseyTs/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/AlekseyTs/roslyn/tags","blobs_url":"https://api.github.com/repos/AlekseyTs/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlekseyTs/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlekseyTs/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlekseyTs/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlekseyTs/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/AlekseyTs/roslyn/languages","stargazers_url":"https://api.github.com/repos/AlekseyTs/roslyn/stargazers","contributors_url":"https://api.github.com/repos/AlekseyTs/roslyn/contributors","subscribers_url":"https://api.github.com/repos/AlekseyTs/roslyn/subscribers","subscription_url":"https://api.github.com/repos/AlekseyTs/roslyn/subscription","commits_url":"https://api.github.com/repos/AlekseyTs/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlekseyTs/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlekseyTs/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlekseyTs/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlekseyTs/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/AlekseyTs/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlekseyTs/roslyn/merges","archive_url":"https://api.github.com/repos/AlekseyTs/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlekseyTs/roslyn/downloads","issues_url":"https://api.github.com/repos/AlekseyTs/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/AlekseyTs/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/AlekseyTs/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/AlekseyTs/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlekseyTs/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/AlekseyTs/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/AlekseyTs/roslyn/deployments","created_at":"2015-03-22T23:43:35Z","updated_at":"2016-01-27T17:38:54Z","pushed_at":"2018-08-29T20:15:42Z","git_url":"git://github.com/AlekseyTs/roslyn.git","ssh_url":"git@github.com:AlekseyTs/roslyn.git","clone_url":"https://github.com/AlekseyTs/roslyn.git","svn_url":"https://github.com/AlekseyTs/roslyn","homepage":"","size":374131,"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,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:features/NullableReferenceTypes","ref":"features/NullableReferenceTypes","sha":"e4bc23b3fb532ead65529f6bd00821d0965e61d8","user":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","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,"node_id":"MDEwOlJlcG9zaXRvcnkyOTA3ODk5Nw==","name":"roslyn","full_name":"dotnet/roslyn","owner":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","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":"2018-08-29T21:49:00Z","pushed_at":"2018-08-29T21:55:08Z","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":439706,"stargazers_count":9769,"watchers_count":9769,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2325,"mirror_url":null,"archived":false,"open_issues_count":5110,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2325,"open_issues":5110,"watchers":9769,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/29586"},"html":{"href":"https://github.com/dotnet/roslyn/pull/29586"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/29586"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/29586/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/29586/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/29586/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/650bdaf79ab1e4e380b6d191045cd8bf84d15926"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"AlekseyTs"}}