{"action":"created","issue":{"url":"https://api.github.com/repos/apple/swift/issues/4227","repository_url":"https://api.github.com/repos/apple/swift","labels_url":"https://api.github.com/repos/apple/swift/issues/4227/labels{/name}","comments_url":"https://api.github.com/repos/apple/swift/issues/4227/comments","events_url":"https://api.github.com/repos/apple/swift/issues/4227/events","html_url":"https://github.com/apple/swift/pull/4227","id":170663511,"number":4227,"title":"[SR-702][Parse] Disallow attributes before '#if'","user":{"login":"rintaro","id":142081,"avatar_url":"https://avatars.githubusercontent.com/u/142081?v=3","gravatar_id":"","url":"https://api.github.com/users/rintaro","html_url":"https://github.com/rintaro","followers_url":"https://api.github.com/users/rintaro/followers","following_url":"https://api.github.com/users/rintaro/following{/other_user}","gists_url":"https://api.github.com/users/rintaro/gists{/gist_id}","starred_url":"https://api.github.com/users/rintaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rintaro/subscriptions","organizations_url":"https://api.github.com/users/rintaro/orgs","repos_url":"https://api.github.com/users/rintaro/repos","events_url":"https://api.github.com/users/rintaro/events{/privacy}","received_events_url":"https://api.github.com/users/rintaro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-11T14:45:00Z","updated_at":"2016-08-12T02:22:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/4227","html_url":"https://github.com/apple/swift/pull/4227","diff_url":"https://github.com/apple/swift/pull/4227.diff","patch_url":"https://github.com/apple/swift/pull/4227.patch"},"body":"#### What's in this pull request?\r\n\r\nThe parser should not allow any attributes before `#if`.\r\n\r\nThe following script used to be accepted:\r\n```\r\nstruct Foo {\r\n  public\r\n#if true\r\n  typealias Bar = Foo\r\n#else\r\n  typealias Bar = Foo\r\n#endif\r\n}\r\n```\r\n`public` were silently discarded in this case.\r\n\r\nWith this PR:\r\n```\r\ntestif.swift:3:1: error: expected declaration\r\n#if true\r\n^\r\ntestif.swift:1:8: note: in declaration of 'Foo'\r\nstruct Foo {\r\n       ^\r\n```\r\n\r\n#### Resolved bug number: ([SR-702](https://bugs.swift.org/browse/SR-702))\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        All supported platforms     | @swift-ci Please smoke test and merge\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\nA smoke test on macOS does the following:\r\n\r\n1. Builds the compiler incrementally.\r\n2. Builds the standard library only for macOS. Simulator standard libraries and\r\n   device standard libraries are not built.\r\n3. lldb is not built.\r\n4. The test and validation-test targets are run only for macOS. The optimized\r\n   version of these tests are not run.\r\n\r\nA smoke test on Linux does the following:\r\n\r\n1. Builds the compiler incrementally.\r\n2. Builds the standard library incrementally.\r\n3. lldb is built incrementally.\r\n4. The swift test and validation-test targets are run. The optimized version of these\r\n   tests are not run.\r\n5. lldb is tested.\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        All supported platforms     | @swift-ci Please test and merge\r\n        OS X platform               | @swift-ci Please test OS X platform\r\n        OS X platform               | @swift-ci Please benchmark\r\n        Linux platform              | @swift-ci Please test Linux platform\r\n\r\n\r\n**Lint Testing**\r\n\r\n        Language     | Comment\r\n        ------------ | -------------\r\n        Python       | @swift-ci Please Python lint\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! -->\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/apple/swift/issues/comments/239346546","html_url":"https://github.com/apple/swift/pull/4227#issuecomment-239346546","issue_url":"https://api.github.com/repos/apple/swift/issues/4227","id":239346546,"user":{"login":"jrose-apple","id":15097531,"avatar_url":"https://avatars.githubusercontent.com/u/15097531?v=3","gravatar_id":"","url":"https://api.github.com/users/jrose-apple","html_url":"https://github.com/jrose-apple","followers_url":"https://api.github.com/users/jrose-apple/followers","following_url":"https://api.github.com/users/jrose-apple/following{/other_user}","gists_url":"https://api.github.com/users/jrose-apple/gists{/gist_id}","starred_url":"https://api.github.com/users/jrose-apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrose-apple/subscriptions","organizations_url":"https://api.github.com/users/jrose-apple/orgs","repos_url":"https://api.github.com/users/jrose-apple/repos","events_url":"https://api.github.com/users/jrose-apple/events{/privacy}","received_events_url":"https://api.github.com/users/jrose-apple/received_events","type":"User","site_admin":false},"created_at":"2016-08-12T02:22:43Z","updated_at":"2016-08-12T02:22:43Z","body":"Doesn't this apply to `#sourceLocation` too?"}}
{"actor":{"display_login":"jrose-apple"}}