{"action":"created","comment":{"url":"https://api.github.com/repos/scala-native/scala-native/pulls/comments/64357646","id":64357646,"diff_hunk":"@@ -157,12 +157,23 @@ abstract class NirCodeGen\n       def pinned =\n         if (!isModule(sym) || isExternModule(sym)) Seq()\n         else Seq(Attr.PinAlways(genMethodName(sym.asClass.primaryConstructor)))\n-\n-      Attrs.fromSeq(\n-          pinned ++ sym.annotations.collect {\n+      val attrs = sym.annotations.collect {\n         case ann if ann.symbol == ExternClass => Attr.Extern\n         case ann if ann.symbol == PureClass   => Attr.Pure\n-      })\n+        case ann if ann.symbol == LinkClass =>\n+          val Apply(_, args) = ann.tree\n+          val values = args.map {\n+            case Literal(Constant(str: String)) => str\n+          }\n+\n+          values match {\n+            case Seq(n)            => Attr.LinkDynamic(n)\n+            case Seq(n, \"dynamic\") => Attr.LinkDynamic(n)\n+            case Seq(n, \"static\")  => Attr.LinkStatic(n)\n+          }","path":"nscplugin/src/main/scala/scala/scalanative/nscplugin/NirCodeGen.scala","position":45,"original_position":45,"commit_id":"a32f93c94205bcf3577a8076031993456b03bd41","original_commit_id":"a32f93c94205bcf3577a8076031993456b03bd41","user":{"login":"sjrd","id":535934,"avatar_url":"https://avatars.githubusercontent.com/u/535934?v=3","gravatar_id":"","url":"https://api.github.com/users/sjrd","html_url":"https://github.com/sjrd","followers_url":"https://api.github.com/users/sjrd/followers","following_url":"https://api.github.com/users/sjrd/following{/other_user}","gists_url":"https://api.github.com/users/sjrd/gists{/gist_id}","starred_url":"https://api.github.com/users/sjrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjrd/subscriptions","organizations_url":"https://api.github.com/users/sjrd/orgs","repos_url":"https://api.github.com/users/sjrd/repos","events_url":"https://api.github.com/users/sjrd/events{/privacy}","received_events_url":"https://api.github.com/users/sjrd/received_events","type":"User","site_admin":false},"body":"What if I write `@link(\"something\", \"foo\")`? You probably don't want to crash. You should report a compile error and gracefully recover with the default.","created_at":"2016-05-24T09:28:10Z","updated_at":"2016-05-24T09:28:10Z","html_url":"https://github.com/scala-native/scala-native/pull/129#discussion_r64357646","pull_request_url":"https://api.github.com/repos/scala-native/scala-native/pulls/129","_links":{"self":{"href":"https://api.github.com/repos/scala-native/scala-native/pulls/comments/64357646"},"html":{"href":"https://github.com/scala-native/scala-native/pull/129#discussion_r64357646"},"pull_request":{"href":"https://api.github.com/repos/scala-native/scala-native/pulls/129"}}},"pull_request":{"url":"https://api.github.com/repos/scala-native/scala-native/pulls/129","id":71178823,"html_url":"https://github.com/scala-native/scala-native/pull/129","diff_url":"https://github.com/scala-native/scala-native/pull/129.diff","patch_url":"https://github.com/scala-native/scala-native/pull/129.patch","issue_url":"https://api.github.com/repos/scala-native/scala-native/issues/129","number":129,"state":"open","locked":false,"title":"Introduce @name and @link annotations","user":{"login":"densh","id":320966,"avatar_url":"https://avatars.githubusercontent.com/u/320966?v=3","gravatar_id":"","url":"https://api.github.com/users/densh","html_url":"https://github.com/densh","followers_url":"https://api.github.com/users/densh/followers","following_url":"https://api.github.com/users/densh/following{/other_user}","gists_url":"https://api.github.com/users/densh/gists{/gist_id}","starred_url":"https://api.github.com/users/densh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/densh/subscriptions","organizations_url":"https://api.github.com/users/densh/orgs","repos_url":"https://api.github.com/users/densh/repos","events_url":"https://api.github.com/users/densh/events{/privacy}","received_events_url":"https://api.github.com/users/densh/received_events","type":"User","site_admin":false},"body":"Introduces two new annotations to improve interop:\r\n\r\n* `@name` lets one bind to differently-named native symbol\r\n* `@link` lets one to automatically link with corresponding native library whenever its used\r\n\r\nReview @sjrd ","created_at":"2016-05-24T08:37:28Z","updated_at":"2016-05-24T09:28:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"18d9d91cdf0ece0c451c1f4501ca9f9396d28771","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scala-native/scala-native/pulls/129/commits","review_comments_url":"https://api.github.com/repos/scala-native/scala-native/pulls/129/comments","review_comment_url":"https://api.github.com/repos/scala-native/scala-native/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scala-native/scala-native/issues/129/comments","statuses_url":"https://api.github.com/repos/scala-native/scala-native/statuses/a32f93c94205bcf3577a8076031993456b03bd41","head":{"label":"scala-native:topic/extern-name-link","ref":"topic/extern-name-link","sha":"a32f93c94205bcf3577a8076031993456b03bd41","user":{"login":"scala-native","id":17545605,"avatar_url":"https://avatars.githubusercontent.com/u/17545605?v=3","gravatar_id":"","url":"https://api.github.com/users/scala-native","html_url":"https://github.com/scala-native","followers_url":"https://api.github.com/users/scala-native/followers","following_url":"https://api.github.com/users/scala-native/following{/other_user}","gists_url":"https://api.github.com/users/scala-native/gists{/gist_id}","starred_url":"https://api.github.com/users/scala-native/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala-native/subscriptions","organizations_url":"https://api.github.com/users/scala-native/orgs","repos_url":"https://api.github.com/users/scala-native/repos","events_url":"https://api.github.com/users/scala-native/events{/privacy}","received_events_url":"https://api.github.com/users/scala-native/received_events","type":"Organization","site_admin":false},"repo":{"id":27235687,"name":"scala-native","full_name":"scala-native/scala-native","owner":{"login":"scala-native","id":17545605,"avatar_url":"https://avatars.githubusercontent.com/u/17545605?v=3","gravatar_id":"","url":"https://api.github.com/users/scala-native","html_url":"https://github.com/scala-native","followers_url":"https://api.github.com/users/scala-native/followers","following_url":"https://api.github.com/users/scala-native/following{/other_user}","gists_url":"https://api.github.com/users/scala-native/gists{/gist_id}","starred_url":"https://api.github.com/users/scala-native/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala-native/subscriptions","organizations_url":"https://api.github.com/users/scala-native/orgs","repos_url":"https://api.github.com/users/scala-native/repos","events_url":"https://api.github.com/users/scala-native/events{/privacy}","received_events_url":"https://api.github.com/users/scala-native/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scala-native/scala-native","description":"Your favourite language gets closer to bare metal.","fork":false,"url":"https://api.github.com/repos/scala-native/scala-native","forks_url":"https://api.github.com/repos/scala-native/scala-native/forks","keys_url":"https://api.github.com/repos/scala-native/scala-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scala-native/scala-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scala-native/scala-native/teams","hooks_url":"https://api.github.com/repos/scala-native/scala-native/hooks","issue_events_url":"https://api.github.com/repos/scala-native/scala-native/issues/events{/number}","events_url":"https://api.github.com/repos/scala-native/scala-native/events","assignees_url":"https://api.github.com/repos/scala-native/scala-native/assignees{/user}","branches_url":"https://api.github.com/repos/scala-native/scala-native/branches{/branch}","tags_url":"https://api.github.com/repos/scala-native/scala-native/tags","blobs_url":"https://api.github.com/repos/scala-native/scala-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scala-native/scala-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scala-native/scala-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/scala-native/scala-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scala-native/scala-native/statuses/{sha}","languages_url":"https://api.github.com/repos/scala-native/scala-native/languages","stargazers_url":"https://api.github.com/repos/scala-native/scala-native/stargazers","contributors_url":"https://api.github.com/repos/scala-native/scala-native/contributors","subscribers_url":"https://api.github.com/repos/scala-native/scala-native/subscribers","subscription_url":"https://api.github.com/repos/scala-native/scala-native/subscription","commits_url":"https://api.github.com/repos/scala-native/scala-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/scala-native/scala-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/scala-native/scala-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/scala-native/scala-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/scala-native/scala-native/contents/{+path}","compare_url":"https://api.github.com/repos/scala-native/scala-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scala-native/scala-native/merges","archive_url":"https://api.github.com/repos/scala-native/scala-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scala-native/scala-native/downloads","issues_url":"https://api.github.com/repos/scala-native/scala-native/issues{/number}","pulls_url":"https://api.github.com/repos/scala-native/scala-native/pulls{/number}","milestones_url":"https://api.github.com/repos/scala-native/scala-native/milestones{/number}","notifications_url":"https://api.github.com/repos/scala-native/scala-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scala-native/scala-native/labels{/name}","releases_url":"https://api.github.com/repos/scala-native/scala-native/releases{/id}","deployments_url":"https://api.github.com/repos/scala-native/scala-native/deployments","created_at":"2014-11-27T17:38:28Z","updated_at":"2016-05-24T09:27:21Z","pushed_at":"2016-05-24T08:55:04Z","git_url":"git://github.com/scala-native/scala-native.git","ssh_url":"git@github.com:scala-native/scala-native.git","clone_url":"https://github.com/scala-native/scala-native.git","svn_url":"https://github.com/scala-native/scala-native","homepage":"http://scala-native.org","size":2121,"stargazers_count":1679,"watchers_count":1679,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":62,"mirror_url":null,"open_issues_count":58,"forks":62,"open_issues":58,"watchers":1679,"default_branch":"master"}},"base":{"label":"scala-native:master","ref":"master","sha":"ec947989d7d699795f32cf5fc5bc1916a178fff1","user":{"login":"scala-native","id":17545605,"avatar_url":"https://avatars.githubusercontent.com/u/17545605?v=3","gravatar_id":"","url":"https://api.github.com/users/scala-native","html_url":"https://github.com/scala-native","followers_url":"https://api.github.com/users/scala-native/followers","following_url":"https://api.github.com/users/scala-native/following{/other_user}","gists_url":"https://api.github.com/users/scala-native/gists{/gist_id}","starred_url":"https://api.github.com/users/scala-native/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala-native/subscriptions","organizations_url":"https://api.github.com/users/scala-native/orgs","repos_url":"https://api.github.com/users/scala-native/repos","events_url":"https://api.github.com/users/scala-native/events{/privacy}","received_events_url":"https://api.github.com/users/scala-native/received_events","type":"Organization","site_admin":false},"repo":{"id":27235687,"name":"scala-native","full_name":"scala-native/scala-native","owner":{"login":"scala-native","id":17545605,"avatar_url":"https://avatars.githubusercontent.com/u/17545605?v=3","gravatar_id":"","url":"https://api.github.com/users/scala-native","html_url":"https://github.com/scala-native","followers_url":"https://api.github.com/users/scala-native/followers","following_url":"https://api.github.com/users/scala-native/following{/other_user}","gists_url":"https://api.github.com/users/scala-native/gists{/gist_id}","starred_url":"https://api.github.com/users/scala-native/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala-native/subscriptions","organizations_url":"https://api.github.com/users/scala-native/orgs","repos_url":"https://api.github.com/users/scala-native/repos","events_url":"https://api.github.com/users/scala-native/events{/privacy}","received_events_url":"https://api.github.com/users/scala-native/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scala-native/scala-native","description":"Your favourite language gets closer to bare metal.","fork":false,"url":"https://api.github.com/repos/scala-native/scala-native","forks_url":"https://api.github.com/repos/scala-native/scala-native/forks","keys_url":"https://api.github.com/repos/scala-native/scala-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scala-native/scala-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scala-native/scala-native/teams","hooks_url":"https://api.github.com/repos/scala-native/scala-native/hooks","issue_events_url":"https://api.github.com/repos/scala-native/scala-native/issues/events{/number}","events_url":"https://api.github.com/repos/scala-native/scala-native/events","assignees_url":"https://api.github.com/repos/scala-native/scala-native/assignees{/user}","branches_url":"https://api.github.com/repos/scala-native/scala-native/branches{/branch}","tags_url":"https://api.github.com/repos/scala-native/scala-native/tags","blobs_url":"https://api.github.com/repos/scala-native/scala-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scala-native/scala-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scala-native/scala-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/scala-native/scala-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scala-native/scala-native/statuses/{sha}","languages_url":"https://api.github.com/repos/scala-native/scala-native/languages","stargazers_url":"https://api.github.com/repos/scala-native/scala-native/stargazers","contributors_url":"https://api.github.com/repos/scala-native/scala-native/contributors","subscribers_url":"https://api.github.com/repos/scala-native/scala-native/subscribers","subscription_url":"https://api.github.com/repos/scala-native/scala-native/subscription","commits_url":"https://api.github.com/repos/scala-native/scala-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/scala-native/scala-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/scala-native/scala-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/scala-native/scala-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/scala-native/scala-native/contents/{+path}","compare_url":"https://api.github.com/repos/scala-native/scala-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scala-native/scala-native/merges","archive_url":"https://api.github.com/repos/scala-native/scala-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scala-native/scala-native/downloads","issues_url":"https://api.github.com/repos/scala-native/scala-native/issues{/number}","pulls_url":"https://api.github.com/repos/scala-native/scala-native/pulls{/number}","milestones_url":"https://api.github.com/repos/scala-native/scala-native/milestones{/number}","notifications_url":"https://api.github.com/repos/scala-native/scala-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scala-native/scala-native/labels{/name}","releases_url":"https://api.github.com/repos/scala-native/scala-native/releases{/id}","deployments_url":"https://api.github.com/repos/scala-native/scala-native/deployments","created_at":"2014-11-27T17:38:28Z","updated_at":"2016-05-24T09:27:21Z","pushed_at":"2016-05-24T08:55:04Z","git_url":"git://github.com/scala-native/scala-native.git","ssh_url":"git@github.com:scala-native/scala-native.git","clone_url":"https://github.com/scala-native/scala-native.git","svn_url":"https://github.com/scala-native/scala-native","homepage":"http://scala-native.org","size":2121,"stargazers_count":1679,"watchers_count":1679,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":62,"mirror_url":null,"open_issues_count":58,"forks":62,"open_issues":58,"watchers":1679,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scala-native/scala-native/pulls/129"},"html":{"href":"https://github.com/scala-native/scala-native/pull/129"},"issue":{"href":"https://api.github.com/repos/scala-native/scala-native/issues/129"},"comments":{"href":"https://api.github.com/repos/scala-native/scala-native/issues/129/comments"},"review_comments":{"href":"https://api.github.com/repos/scala-native/scala-native/pulls/129/comments"},"review_comment":{"href":"https://api.github.com/repos/scala-native/scala-native/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scala-native/scala-native/pulls/129/commits"},"statuses":{"href":"https://api.github.com/repos/scala-native/scala-native/statuses/a32f93c94205bcf3577a8076031993456b03bd41"}}}}
{"actor":{"display_login":"sjrd"}}