{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/comments/29195459","id":29195459,"diff_hunk":"@@ -26,5 +29,60 @@ public void VerifyConstructor()\n             Assert.Equal(methodSignature.GenericParameterCount, genericParameterCount);\n             Assert.Equal(methodSignature.ParameterTypes, parameterTypes);\n         }\n+\n+        [Fact]\n+        public unsafe void VerifyMultipleOptionalModifiers()\n+        {\n+            // Type 1: int32 modopt([mscorlib]System.Runtime.CompilerServices.IsLong) modopt([mscorlib]System.Runtime.CompilerServices.CallConvCdecl)\n+            // Type 2: char* \n+            // Type 3: uint32 \n+            // Type 4: char modopt([mscorlib]System.Runtime.CompilerServices.IsConst)*\n+            var testSignature = new byte[] { 0x20, 0x45, 0x20, 0x69, 0x08, 0x0F, 0x03, 0x09, 0x0F, 0x20, 0x55, 0x03 };\n+            var types = new string[]\n+            {\n+                \"11 1A Int32\",  // This has multiple modifiers, which exercises different code paths than single modifiers\n+                \"Char*\",\n+                \"UInt32\",\n+                \"15 Char*\"\n+            };\n+\n+            fixed (byte* testSignaturePtr = &testSignature[0])\n+            {\n+                var signatureBlob = new BlobReader(testSignaturePtr, testSignature.Length);\n+                var sigTypeProvider = new TestSignatureTypeProvider();\n+\n+                foreach (string typeString in types)\n+                {\n+                    // Verify that each type is decoded as expected\n+                    Assert.Equal(typeString, SignatureDecoder.DecodeType(ref signatureBlob, sigTypeProvider));\n+                }\n+                // And that nothing is left over to decode\n+                Assert.Throws<BadImageFormatException>(() => SignatureDecoder.DecodeType(ref signatureBlob, sigTypeProvider));\n+            }\n+        }\n+    }\n+\n+    // Simple test implementation of ISignatureTypeProvider to check that the right types are decoded\n+    internal class TestSignatureTypeProvider:ISignatureTypeProvider<string>","path":"src/System.Reflection.Metadata/tests/Metadata/Decoding/MethodSignatureTests.cs","position":48,"original_position":48,"commit_id":"611977c3b3b6e1c1f2ae78f7b33186834e7aea4d","original_commit_id":"611977c3b3b6e1c1f2ae78f7b33186834e7aea4d","user":{"login":"mjrousos","id":10077254,"avatar_url":"https://avatars.githubusercontent.com/u/10077254?v=3","gravatar_id":"","url":"https://api.github.com/users/mjrousos","html_url":"https://github.com/mjrousos","followers_url":"https://api.github.com/users/mjrousos/followers","following_url":"https://api.github.com/users/mjrousos/following{/other_user}","gists_url":"https://api.github.com/users/mjrousos/gists{/gist_id}","starred_url":"https://api.github.com/users/mjrousos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjrousos/subscriptions","organizations_url":"https://api.github.com/users/mjrousos/orgs","repos_url":"https://api.github.com/users/mjrousos/repos","events_url":"https://api.github.com/users/mjrousos/events{/privacy}","received_events_url":"https://api.github.com/users/mjrousos/received_events","type":"User","site_admin":false},"body":"Good point; there's no reason for this to be internal rather than private.","created_at":"2015-04-27T21:51:35Z","updated_at":"2015-04-27T21:51:35Z","html_url":"https://github.com/dotnet/corefx/pull/1543#discussion_r29195459","pull_request_url":"https://api.github.com/repos/dotnet/corefx/pulls/1543","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments/29195459"},"html":{"href":"https://github.com/dotnet/corefx/pull/1543#discussion_r29195459"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/1543"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/1543","id":34211797,"html_url":"https://github.com/dotnet/corefx/pull/1543","diff_url":"https://github.com/dotnet/corefx/pull/1543.diff","patch_url":"https://github.com/dotnet/corefx/pull/1543.patch","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/1543","number":1543,"state":"open","locked":false,"title":"Fix decoding of multi-mod types in signatures","user":{"login":"mjrousos","id":10077254,"avatar_url":"https://avatars.githubusercontent.com/u/10077254?v=3","gravatar_id":"","url":"https://api.github.com/users/mjrousos","html_url":"https://github.com/mjrousos","followers_url":"https://api.github.com/users/mjrousos/followers","following_url":"https://api.github.com/users/mjrousos/following{/other_user}","gists_url":"https://api.github.com/users/mjrousos/gists{/gist_id}","starred_url":"https://api.github.com/users/mjrousos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjrousos/subscriptions","organizations_url":"https://api.github.com/users/mjrousos/orgs","repos_url":"https://api.github.com/users/mjrousos/repos","events_url":"https://api.github.com/users/mjrousos/events{/privacy}","received_events_url":"https://api.github.com/users/mjrousos/received_events","type":"User","site_admin":false},"body":"Address issue #1535 by updating the metadata reader's signature decoder to correctly decode types with multiple modifiers.","created_at":"2015-04-27T21:22:34Z","updated_at":"2015-04-27T21:51:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d017ca25b823af5a1de8bcb8138266350b7e8764","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corefx/pulls/1543/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefx/pulls/1543/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/1543/comments","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/611977c3b3b6e1c1f2ae78f7b33186834e7aea4d","head":{"label":"mjrousos:dev/metadata","ref":"dev/metadata","sha":"611977c3b3b6e1c1f2ae78f7b33186834e7aea4d","user":{"login":"mjrousos","id":10077254,"avatar_url":"https://avatars.githubusercontent.com/u/10077254?v=3","gravatar_id":"","url":"https://api.github.com/users/mjrousos","html_url":"https://github.com/mjrousos","followers_url":"https://api.github.com/users/mjrousos/followers","following_url":"https://api.github.com/users/mjrousos/following{/other_user}","gists_url":"https://api.github.com/users/mjrousos/gists{/gist_id}","starred_url":"https://api.github.com/users/mjrousos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjrousos/subscriptions","organizations_url":"https://api.github.com/users/mjrousos/orgs","repos_url":"https://api.github.com/users/mjrousos/repos","events_url":"https://api.github.com/users/mjrousos/events{/privacy}","received_events_url":"https://api.github.com/users/mjrousos/received_events","type":"User","site_admin":false},"repo":{"id":29693745,"name":"corefx","full_name":"mjrousos/corefx","owner":{"login":"mjrousos","id":10077254,"avatar_url":"https://avatars.githubusercontent.com/u/10077254?v=3","gravatar_id":"","url":"https://api.github.com/users/mjrousos","html_url":"https://github.com/mjrousos","followers_url":"https://api.github.com/users/mjrousos/followers","following_url":"https://api.github.com/users/mjrousos/following{/other_user}","gists_url":"https://api.github.com/users/mjrousos/gists{/gist_id}","starred_url":"https://api.github.com/users/mjrousos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjrousos/subscriptions","organizations_url":"https://api.github.com/users/mjrousos/orgs","repos_url":"https://api.github.com/users/mjrousos/repos","events_url":"https://api.github.com/users/mjrousos/events{/privacy}","received_events_url":"https://api.github.com/users/mjrousos/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mjrousos/corefx","description":"This repository contains the foundational libraries that make up the .NET Core development stack.","fork":true,"url":"https://api.github.com/repos/mjrousos/corefx","forks_url":"https://api.github.com/repos/mjrousos/corefx/forks","keys_url":"https://api.github.com/repos/mjrousos/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mjrousos/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mjrousos/corefx/teams","hooks_url":"https://api.github.com/repos/mjrousos/corefx/hooks","issue_events_url":"https://api.github.com/repos/mjrousos/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/mjrousos/corefx/events","assignees_url":"https://api.github.com/repos/mjrousos/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/mjrousos/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/mjrousos/corefx/tags","blobs_url":"https://api.github.com/repos/mjrousos/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mjrousos/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mjrousos/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/mjrousos/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mjrousos/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/mjrousos/corefx/languages","stargazers_url":"https://api.github.com/repos/mjrousos/corefx/stargazers","contributors_url":"https://api.github.com/repos/mjrousos/corefx/contributors","subscribers_url":"https://api.github.com/repos/mjrousos/corefx/subscribers","subscription_url":"https://api.github.com/repos/mjrousos/corefx/subscription","commits_url":"https://api.github.com/repos/mjrousos/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/mjrousos/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/mjrousos/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/mjrousos/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/mjrousos/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/mjrousos/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mjrousos/corefx/merges","archive_url":"https://api.github.com/repos/mjrousos/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mjrousos/corefx/downloads","issues_url":"https://api.github.com/repos/mjrousos/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/mjrousos/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/mjrousos/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/mjrousos/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mjrousos/corefx/labels{/name}","releases_url":"https://api.github.com/repos/mjrousos/corefx/releases{/id}","created_at":"2015-01-22T18:39:35Z","updated_at":"2015-04-27T17:59:43Z","pushed_at":"2015-04-27T21:45:12Z","git_url":"git://github.com/mjrousos/corefx.git","ssh_url":"git@github.com:mjrousos/corefx.git","clone_url":"https://github.com/mjrousos/corefx.git","svn_url":"https://github.com/mjrousos/corefx","homepage":"","size":17295,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:dev/metadata","ref":"dev/metadata","sha":"81e8c0531cb4f7202bd07d021c5a152821febed5","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","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":26295345,"name":"corefx","full_name":"dotnet/corefx","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","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/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others.","fork":false,"url":"https://api.github.com/repos/dotnet/corefx","forks_url":"https://api.github.com/repos/dotnet/corefx/forks","keys_url":"https://api.github.com/repos/dotnet/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/corefx/teams","hooks_url":"https://api.github.com/repos/dotnet/corefx/hooks","issue_events_url":"https://api.github.com/repos/dotnet/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/corefx/events","assignees_url":"https://api.github.com/repos/dotnet/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/corefx/tags","blobs_url":"https://api.github.com/repos/dotnet/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/corefx/languages","stargazers_url":"https://api.github.com/repos/dotnet/corefx/stargazers","contributors_url":"https://api.github.com/repos/dotnet/corefx/contributors","subscribers_url":"https://api.github.com/repos/dotnet/corefx/subscribers","subscription_url":"https://api.github.com/repos/dotnet/corefx/subscription","commits_url":"https://api.github.com/repos/dotnet/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/corefx/merges","archive_url":"https://api.github.com/repos/dotnet/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/corefx/downloads","issues_url":"https://api.github.com/repos/dotnet/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/corefx/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/corefx/releases{/id}","created_at":"2014-11-06T23:42:48Z","updated_at":"2015-04-27T21:44:22Z","pushed_at":"2015-04-27T21:48:28Z","git_url":"git://github.com/dotnet/corefx.git","ssh_url":"git@github.com:dotnet/corefx.git","clone_url":"https://github.com/dotnet/corefx.git","svn_url":"https://github.com/dotnet/corefx","homepage":"","size":38407,"stargazers_count":7506,"watchers_count":7506,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1488,"mirror_url":null,"open_issues_count":344,"forks":1488,"open_issues":344,"watchers":7506,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/1543"},"html":{"href":"https://github.com/dotnet/corefx/pull/1543"},"issue":{"href":"https://api.github.com/repos/dotnet/corefx/issues/1543"},"comments":{"href":"https://api.github.com/repos/dotnet/corefx/issues/1543/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/1543/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/1543/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefx/statuses/611977c3b3b6e1c1f2ae78f7b33186834e7aea4d"}}}}