{"action":"created","comment":{"url":"https://api.github.com/repos/apple/swift/pulls/comments/57544711","id":57544711,"diff_hunk":"@@ -242,26 +238,47 @@ Parser::parseParameterClause(SourceLoc &leftParenLoc,\n       }\n \n       // (':' ('inout')? type)?\n+      // also handle the case of (':' ('let' or 'var')? type)? as errors\n+      // and give diagnostics for that case\n       if (consumeIf(tok::colon)) {\n \n         SourceLoc postColonLoc = Tok.getLoc();\n \n         bool hasDeprecatedInOut =\n           param.SpecifierKind == ParsedParameter::InOut;\n-\n-        if (Tok.is(tok::kw_inout)) {\n-          param.LetVarInOutLoc = consumeToken();\n-          param.SpecifierKind = ParsedParameter::InOut;\n-          if (hasDeprecatedInOut) {\n-            diagnose(param.LetVarInOutLoc, diag::inout_as_attr_deprecated)\n-              .fixItRemove(param.LetVarInOutLoc);\n+        bool hasValidInOut = false;\n+        \n+        while (Tok.isAny(tok::kw_inout, tok::kw_let, tok::kw_var)) {\n+          if (Tok.is(tok::kw_var)) {\n+            diagnose(Tok.getLoc(), diag::parameter_var_as_attr)\n+            .fixItRemove(Tok.getLoc());\n+            consumeToken();\n+            param.isInvalid = true;\n+          } else if (Tok.is(tok::kw_let)) {\n+            diagnose(Tok.getLoc(), diag::parameter_let_as_attr).\n+            fixItRemove(Tok.getLoc());","path":"lib/Parse/ParsePattern.cpp","position":72,"original_position":72,"commit_id":"cea31049a1a2caa97e4f9d52b6a99b930a176c5f","original_commit_id":"cea31049a1a2caa97e4f9d52b6a99b930a176c5f","user":{"login":"manavgabhawala","id":8603246,"avatar_url":"https://avatars.githubusercontent.com/u/8603246?v=3","gravatar_id":"","url":"https://api.github.com/users/manavgabhawala","html_url":"https://github.com/manavgabhawala","followers_url":"https://api.github.com/users/manavgabhawala/followers","following_url":"https://api.github.com/users/manavgabhawala/following{/other_user}","gists_url":"https://api.github.com/users/manavgabhawala/gists{/gist_id}","starred_url":"https://api.github.com/users/manavgabhawala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manavgabhawala/subscriptions","organizations_url":"https://api.github.com/users/manavgabhawala/orgs","repos_url":"https://api.github.com/users/manavgabhawala/repos","events_url":"https://api.github.com/users/manavgabhawala/events{/privacy}","received_events_url":"https://api.github.com/users/manavgabhawala/received_events","type":"User","site_admin":false},"body":"Okay great. Should we then allow `let` `var` and `inout` be argument labels, or warn/error and give fixit information for those?","created_at":"2016-03-28T04:50:21Z","updated_at":"2016-03-28T04:50:21Z","html_url":"https://github.com/apple/swift/pull/1812#discussion_r57544711","pull_request_url":"https://api.github.com/repos/apple/swift/pulls/1812","_links":{"self":{"href":"https://api.github.com/repos/apple/swift/pulls/comments/57544711"},"html":{"href":"https://github.com/apple/swift/pull/1812#discussion_r57544711"},"pull_request":{"href":"https://api.github.com/repos/apple/swift/pulls/1812"}}},"pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/1812","id":63959675,"html_url":"https://github.com/apple/swift/pull/1812","diff_url":"https://github.com/apple/swift/pull/1812.diff","patch_url":"https://github.com/apple/swift/pull/1812.patch","issue_url":"https://api.github.com/repos/apple/swift/issues/1812","number":1812,"state":"open","locked":false,"title":"[Parser] Cleans up parsing of function parameter attributes","user":{"login":"manavgabhawala","id":8603246,"avatar_url":"https://avatars.githubusercontent.com/u/8603246?v=3","gravatar_id":"","url":"https://api.github.com/users/manavgabhawala","html_url":"https://github.com/manavgabhawala","followers_url":"https://api.github.com/users/manavgabhawala/followers","following_url":"https://api.github.com/users/manavgabhawala/following{/other_user}","gists_url":"https://api.github.com/users/manavgabhawala/gists{/gist_id}","starred_url":"https://api.github.com/users/manavgabhawala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manavgabhawala/subscriptions","organizations_url":"https://api.github.com/users/manavgabhawala/orgs","repos_url":"https://api.github.com/users/manavgabhawala/repos","events_url":"https://api.github.com/users/manavgabhawala/events{/privacy}","received_events_url":"https://api.github.com/users/manavgabhawala/received_events","type":"User","site_admin":false},"body":"#### What's in this pull request?\r\nThis pull request cleans up parsing of parameter attributes by parsing the inout, let and var tokens better. It cleans up the implementation to work better with SE-0003 by giving better fix-its and diagnostics for var as parameter attributes. It also provides better fixits for `let` and `inout` that are either duplicated or misplaced. \r\n\r\n#### Resolved bug number: \r\n- [SR-979](https://bugs.swift.org/browse/SR-979)\r\n\r\n* * * *\r\n\r\n<!-- This selection should only be completed by Swift admin -->\r\nBefore merging this pull request to apple/swift repository:\r\n- [ ] Test pull request on Swift continuous integration.\r\n\r\n<details>\r\n  <summary>Triggering Swift CI</summary>\r\n\r\nThe swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:\r\n\r\n**Smoke Testing**\r\n\r\n        Platform     | Comment\r\n        ------------ | -------------\r\n        All supported platforms     | @swift-ci Please smoke test\r\n        OS X platform               | @swift-ci Please smoke test OS X platform\r\n        Linux platform              | @swift-ci Please smoke test Linux platform\r\n\r\n **Validation Testing**\r\n\r\n        Platform     | Comment\r\n        ------------ | -------------\r\n        All supported platforms     | @swift-ci Please test\r\n        OS X platform               | @swift-ci Please test OS X platform\r\n        Linux platform              | @swift-ci Please test Linux platform\r\n\r\nNote: Only members of the Apple organization can trigger swift-ci.\r\n</details>\r\n<!-- Thank you for your contribution to Swift! -->","created_at":"2016-03-23T21:56:58Z","updated_at":"2016-03-28T04:50:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6b2df5c96ec6c84dfb5140dc60d4e97402d19088","assignee":{"login":"lattner","id":15152540,"avatar_url":"https://avatars.githubusercontent.com/u/15152540?v=3","gravatar_id":"","url":"https://api.github.com/users/lattner","html_url":"https://github.com/lattner","followers_url":"https://api.github.com/users/lattner/followers","following_url":"https://api.github.com/users/lattner/following{/other_user}","gists_url":"https://api.github.com/users/lattner/gists{/gist_id}","starred_url":"https://api.github.com/users/lattner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lattner/subscriptions","organizations_url":"https://api.github.com/users/lattner/orgs","repos_url":"https://api.github.com/users/lattner/repos","events_url":"https://api.github.com/users/lattner/events{/privacy}","received_events_url":"https://api.github.com/users/lattner/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/apple/swift/pulls/1812/commits","review_comments_url":"https://api.github.com/repos/apple/swift/pulls/1812/comments","review_comment_url":"https://api.github.com/repos/apple/swift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apple/swift/issues/1812/comments","statuses_url":"https://api.github.com/repos/apple/swift/statuses/cea31049a1a2caa97e4f9d52b6a99b930a176c5f","head":{"label":"manavgabhawala:master","ref":"master","sha":"cea31049a1a2caa97e4f9d52b6a99b930a176c5f","user":{"login":"manavgabhawala","id":8603246,"avatar_url":"https://avatars.githubusercontent.com/u/8603246?v=3","gravatar_id":"","url":"https://api.github.com/users/manavgabhawala","html_url":"https://github.com/manavgabhawala","followers_url":"https://api.github.com/users/manavgabhawala/followers","following_url":"https://api.github.com/users/manavgabhawala/following{/other_user}","gists_url":"https://api.github.com/users/manavgabhawala/gists{/gist_id}","starred_url":"https://api.github.com/users/manavgabhawala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manavgabhawala/subscriptions","organizations_url":"https://api.github.com/users/manavgabhawala/orgs","repos_url":"https://api.github.com/users/manavgabhawala/repos","events_url":"https://api.github.com/users/manavgabhawala/events{/privacy}","received_events_url":"https://api.github.com/users/manavgabhawala/received_events","type":"User","site_admin":false},"repo":{"id":47532655,"name":"swift","full_name":"manavgabhawala/swift","owner":{"login":"manavgabhawala","id":8603246,"avatar_url":"https://avatars.githubusercontent.com/u/8603246?v=3","gravatar_id":"","url":"https://api.github.com/users/manavgabhawala","html_url":"https://github.com/manavgabhawala","followers_url":"https://api.github.com/users/manavgabhawala/followers","following_url":"https://api.github.com/users/manavgabhawala/following{/other_user}","gists_url":"https://api.github.com/users/manavgabhawala/gists{/gist_id}","starred_url":"https://api.github.com/users/manavgabhawala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manavgabhawala/subscriptions","organizations_url":"https://api.github.com/users/manavgabhawala/orgs","repos_url":"https://api.github.com/users/manavgabhawala/repos","events_url":"https://api.github.com/users/manavgabhawala/events{/privacy}","received_events_url":"https://api.github.com/users/manavgabhawala/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/manavgabhawala/swift","description":"The Swift Programming Language","fork":true,"url":"https://api.github.com/repos/manavgabhawala/swift","forks_url":"https://api.github.com/repos/manavgabhawala/swift/forks","keys_url":"https://api.github.com/repos/manavgabhawala/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/manavgabhawala/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/manavgabhawala/swift/teams","hooks_url":"https://api.github.com/repos/manavgabhawala/swift/hooks","issue_events_url":"https://api.github.com/repos/manavgabhawala/swift/issues/events{/number}","events_url":"https://api.github.com/repos/manavgabhawala/swift/events","assignees_url":"https://api.github.com/repos/manavgabhawala/swift/assignees{/user}","branches_url":"https://api.github.com/repos/manavgabhawala/swift/branches{/branch}","tags_url":"https://api.github.com/repos/manavgabhawala/swift/tags","blobs_url":"https://api.github.com/repos/manavgabhawala/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/manavgabhawala/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/manavgabhawala/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/manavgabhawala/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/manavgabhawala/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/manavgabhawala/swift/languages","stargazers_url":"https://api.github.com/repos/manavgabhawala/swift/stargazers","contributors_url":"https://api.github.com/repos/manavgabhawala/swift/contributors","subscribers_url":"https://api.github.com/repos/manavgabhawala/swift/subscribers","subscription_url":"https://api.github.com/repos/manavgabhawala/swift/subscription","commits_url":"https://api.github.com/repos/manavgabhawala/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/manavgabhawala/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/manavgabhawala/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/manavgabhawala/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/manavgabhawala/swift/contents/{+path}","compare_url":"https://api.github.com/repos/manavgabhawala/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/manavgabhawala/swift/merges","archive_url":"https://api.github.com/repos/manavgabhawala/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/manavgabhawala/swift/downloads","issues_url":"https://api.github.com/repos/manavgabhawala/swift/issues{/number}","pulls_url":"https://api.github.com/repos/manavgabhawala/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/manavgabhawala/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/manavgabhawala/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/manavgabhawala/swift/labels{/name}","releases_url":"https://api.github.com/repos/manavgabhawala/swift/releases{/id}","deployments_url":"https://api.github.com/repos/manavgabhawala/swift/deployments","created_at":"2015-12-07T06:03:39Z","updated_at":"2016-03-19T05:27:47Z","pushed_at":"2016-03-26T05:30:38Z","git_url":"git://github.com/manavgabhawala/swift.git","ssh_url":"git@github.com:manavgabhawala/swift.git","clone_url":"https://github.com/manavgabhawala/swift.git","svn_url":"https://github.com/manavgabhawala/swift","homepage":"","size":81645,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"apple:master","ref":"master","sha":"1e97da25b436887d704b50e5f1a9b8522a4e64fa","user":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"repo":{"id":44838949,"name":"swift","full_name":"apple/swift","owner":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apple/swift","description":"The Swift Programming Language","fork":false,"url":"https://api.github.com/repos/apple/swift","forks_url":"https://api.github.com/repos/apple/swift/forks","keys_url":"https://api.github.com/repos/apple/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apple/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apple/swift/teams","hooks_url":"https://api.github.com/repos/apple/swift/hooks","issue_events_url":"https://api.github.com/repos/apple/swift/issues/events{/number}","events_url":"https://api.github.com/repos/apple/swift/events","assignees_url":"https://api.github.com/repos/apple/swift/assignees{/user}","branches_url":"https://api.github.com/repos/apple/swift/branches{/branch}","tags_url":"https://api.github.com/repos/apple/swift/tags","blobs_url":"https://api.github.com/repos/apple/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apple/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apple/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/apple/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apple/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/apple/swift/languages","stargazers_url":"https://api.github.com/repos/apple/swift/stargazers","contributors_url":"https://api.github.com/repos/apple/swift/contributors","subscribers_url":"https://api.github.com/repos/apple/swift/subscribers","subscription_url":"https://api.github.com/repos/apple/swift/subscription","commits_url":"https://api.github.com/repos/apple/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/apple/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/apple/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/apple/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/apple/swift/contents/{+path}","compare_url":"https://api.github.com/repos/apple/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apple/swift/merges","archive_url":"https://api.github.com/repos/apple/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apple/swift/downloads","issues_url":"https://api.github.com/repos/apple/swift/issues{/number}","pulls_url":"https://api.github.com/repos/apple/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/apple/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/apple/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apple/swift/labels{/name}","releases_url":"https://api.github.com/repos/apple/swift/releases{/id}","deployments_url":"https://api.github.com/repos/apple/swift/deployments","created_at":"2015-10-23T21:15:07Z","updated_at":"2016-03-28T04:02:53Z","pushed_at":"2016-03-28T04:40:20Z","git_url":"git://github.com/apple/swift.git","ssh_url":"git@github.com:apple/swift.git","clone_url":"https://github.com/apple/swift.git","svn_url":"https://github.com/apple/swift","homepage":"https://swift.org/","size":113719,"stargazers_count":28087,"watchers_count":28087,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3697,"mirror_url":null,"open_issues_count":79,"forks":3697,"open_issues":79,"watchers":28087,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apple/swift/pulls/1812"},"html":{"href":"https://github.com/apple/swift/pull/1812"},"issue":{"href":"https://api.github.com/repos/apple/swift/issues/1812"},"comments":{"href":"https://api.github.com/repos/apple/swift/issues/1812/comments"},"review_comments":{"href":"https://api.github.com/repos/apple/swift/pulls/1812/comments"},"review_comment":{"href":"https://api.github.com/repos/apple/swift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apple/swift/pulls/1812/commits"},"statuses":{"href":"https://api.github.com/repos/apple/swift/statuses/cea31049a1a2caa97e4f9d52b6a99b930a176c5f"}}}}