{"action":"created","issue":{"url":"https://api.github.com/repos/scala/scala/issues/5350","repository_url":"https://api.github.com/repos/scala/scala","labels_url":"https://api.github.com/repos/scala/scala/issues/5350/labels{/name}","comments_url":"https://api.github.com/repos/scala/scala/issues/5350/comments","events_url":"https://api.github.com/repos/scala/scala/issues/5350/events","html_url":"https://github.com/scala/scala/pull/5350","id":172024516,"number":5350,"title":"Add flags -Ysysdef and -Ypredef to configure root imports [ci: last-only]","user":{"login":"andyscott","id":310363,"avatar_url":"https://avatars.githubusercontent.com/u/310363?v=3","gravatar_id":"","url":"https://api.github.com/users/andyscott","html_url":"https://github.com/andyscott","followers_url":"https://api.github.com/users/andyscott/followers","following_url":"https://api.github.com/users/andyscott/following{/other_user}","gists_url":"https://api.github.com/users/andyscott/gists{/gist_id}","starred_url":"https://api.github.com/users/andyscott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyscott/subscriptions","organizations_url":"https://api.github.com/users/andyscott/orgs","repos_url":"https://api.github.com/users/andyscott/repos","events_url":"https://api.github.com/users/andyscott/events{/privacy}","received_events_url":"https://api.github.com/users/andyscott/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"adriaanm","id":91083,"avatar_url":"https://avatars.githubusercontent.com/u/91083?v=3","gravatar_id":"","url":"https://api.github.com/users/adriaanm","html_url":"https://github.com/adriaanm","followers_url":"https://api.github.com/users/adriaanm/followers","following_url":"https://api.github.com/users/adriaanm/following{/other_user}","gists_url":"https://api.github.com/users/adriaanm/gists{/gist_id}","starred_url":"https://api.github.com/users/adriaanm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriaanm/subscriptions","organizations_url":"https://api.github.com/users/adriaanm/orgs","repos_url":"https://api.github.com/users/adriaanm/repos","events_url":"https://api.github.com/users/adriaanm/events{/privacy}","received_events_url":"https://api.github.com/users/adriaanm/received_events","type":"User","site_admin":false},"assignees":[{"login":"adriaanm","id":91083,"avatar_url":"https://avatars.githubusercontent.com/u/91083?v=3","gravatar_id":"","url":"https://api.github.com/users/adriaanm","html_url":"https://github.com/adriaanm","followers_url":"https://api.github.com/users/adriaanm/followers","following_url":"https://api.github.com/users/adriaanm/following{/other_user}","gists_url":"https://api.github.com/users/adriaanm/gists{/gist_id}","starred_url":"https://api.github.com/users/adriaanm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriaanm/subscriptions","organizations_url":"https://api.github.com/users/adriaanm/orgs","repos_url":"https://api.github.com/users/adriaanm/repos","events_url":"https://api.github.com/users/adriaanm/events{/privacy}","received_events_url":"https://api.github.com/users/adriaanm/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/scala/scala/milestones/59","html_url":"https://github.com/scala/scala/milestone/59","labels_url":"https://api.github.com/repos/scala/scala/milestones/59/labels","id":2100825,"number":59,"title":"2.12.2","description":"Merge to 2.12.x. ","creator":{"login":"adriaanm","id":91083,"avatar_url":"https://avatars.githubusercontent.com/u/91083?v=3","gravatar_id":"","url":"https://api.github.com/users/adriaanm","html_url":"https://github.com/adriaanm","followers_url":"https://api.github.com/users/adriaanm/followers","following_url":"https://api.github.com/users/adriaanm/following{/other_user}","gists_url":"https://api.github.com/users/adriaanm/gists{/gist_id}","starred_url":"https://api.github.com/users/adriaanm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriaanm/subscriptions","organizations_url":"https://api.github.com/users/adriaanm/orgs","repos_url":"https://api.github.com/users/adriaanm/repos","events_url":"https://api.github.com/users/adriaanm/events{/privacy}","received_events_url":"https://api.github.com/users/adriaanm/received_events","type":"User","site_admin":false},"open_issues":28,"closed_issues":27,"state":"open","created_at":"2016-10-28T22:48:34Z","updated_at":"2016-12-20T12:32:02Z","due_on":"2017-02-27T08:00:00Z","closed_at":null},"comments":46,"created_at":"2016-08-18T23:34:03Z","updated_at":"2016-12-20T23:19:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scala/scala/pulls/5350","html_url":"https://github.com/scala/scala/pull/5350","diff_url":"https://github.com/scala/scala/pull/5350.diff","patch_url":"https://github.com/scala/scala/pull/5350.patch"},"body":"This adds a `-Ysysdef` and `-Ypredef` flag to give you full control over global imports for Scala compilation units.\r\n\r\n_Background information:_\r\n\r\nBy default, scalac imports `java.lang._`, `scala._`, and `scala.Predef._` into the namespace of Scala compilation units.\r\n\r\nAs it stands, we have two existing flags that adjust the behavior of predefined imports.\r\n- `-Yno-imports` disables all of these.\r\n- `-Yno-predef` disables `scala.Predef._`.\r\n\r\nThere are a few other nuances to the behavior of imports. The most important behavior is that `scala.Predef._` is unimported/evicted if there are any direct leading imports for anything within `scala.Predef`. For example, an import to `scala.Predef.DummyImplicit` will cause everything else normally imported by predef to be unimported.\r\n\r\n#### Changes\r\n- Introduces the notion of \"sysdefs\" and \"predefs\" for Scala compilation units. Sysdefs are global imports that are imported at the top of all Scala compilation units _under all circumstances_. Predefs are imported after sysdefs and can be masked by top level imports in the source file (to match the existing behavior of directly importing from `scala.Predef`).\r\n- Adds `-Ysysdef` which controls the global sysdef imports for all Scala compilation units. The default value is set to `java.lang._; scala._`.\r\n- Added `-Ypredef` which controls the predef imports for Scala compilation units. The default value is set to `scala.Predef._`.\r\n\r\n\r\nI'd be great to get any feedback. I would also to back port this to 2.11.\r\n"},"comment":{"url":"https://api.github.com/repos/scala/scala/issues/comments/268387925","html_url":"https://github.com/scala/scala/pull/5350#issuecomment-268387925","issue_url":"https://api.github.com/repos/scala/scala/issues/5350","id":268387925,"user":{"login":"adriaanm","id":91083,"avatar_url":"https://avatars.githubusercontent.com/u/91083?v=3","gravatar_id":"","url":"https://api.github.com/users/adriaanm","html_url":"https://github.com/adriaanm","followers_url":"https://api.github.com/users/adriaanm/followers","following_url":"https://api.github.com/users/adriaanm/following{/other_user}","gists_url":"https://api.github.com/users/adriaanm/gists{/gist_id}","starred_url":"https://api.github.com/users/adriaanm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriaanm/subscriptions","organizations_url":"https://api.github.com/users/adriaanm/orgs","repos_url":"https://api.github.com/users/adriaanm/repos","events_url":"https://api.github.com/users/adriaanm/events{/privacy}","received_events_url":"https://api.github.com/users/adriaanm/received_events","type":"User","site_admin":false},"created_at":"2016-12-20T23:19:31Z","updated_at":"2016-12-20T23:19:31Z","body":"If you don't want it, you'd pass in `scala.Predef.{any2stringad => _, _}`"}}
{"actor":{"display_login":"adriaanm"}}