{"action":"created","issue":{"url":"https://api.github.com/repos/lampepfl/dotty/issues/749","labels_url":"https://api.github.com/repos/lampepfl/dotty/issues/749/labels{/name}","comments_url":"https://api.github.com/repos/lampepfl/dotty/issues/749/comments","events_url":"https://api.github.com/repos/lampepfl/dotty/issues/749/events","html_url":"https://github.com/lampepfl/dotty/pull/749","id":99289658,"number":749,"title":"Typer#escapingRefs: don't let the types of lower bounds escape","user":{"login":"smarter","id":63430,"avatar_url":"https://avatars.githubusercontent.com/u/63430?v=3","gravatar_id":"","url":"https://api.github.com/users/smarter","html_url":"https://github.com/smarter","followers_url":"https://api.github.com/users/smarter/followers","following_url":"https://api.github.com/users/smarter/following{/other_user}","gists_url":"https://api.github.com/users/smarter/gists{/gist_id}","starred_url":"https://api.github.com/users/smarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarter/subscriptions","organizations_url":"https://api.github.com/users/smarter/orgs","repos_url":"https://api.github.com/users/smarter/repos","events_url":"https://api.github.com/users/smarter/events{/privacy}","received_events_url":"https://api.github.com/users/smarter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-05T20:17:33Z","updated_at":"2015-08-05T21:44:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/lampepfl/dotty/pulls/749","html_url":"https://github.com/lampepfl/dotty/pull/749","diff_url":"https://github.com/lampepfl/dotty/pull/749.diff","patch_url":"https://github.com/lampepfl/dotty/pull/749.patch"},"body":"In 0efa171e8ccca0d49fc6d800fd21e29f7b7336fd I changed the definition of `NamedPartsAccumulator` to exclude lower bounds as this is required for the implicit search, but `NamedPartsAccumulator` is also used by `Typer#escapingRefs` so in the following code:\r\n```scala\r\nclass Foo[T]\r\nval z = {\r\n  class C\r\n\r\n  ??? : Foo[_ >: C]\r\n}\r\n```\r\nthe type of `z` was inferred to be `Foo[_ >: C]` instead of `Foo`.\r\n\r\nTo avoid this, `NamedPartsAccumulator` will only exclude lower bounds if the parameter `excludeLowerBounds` is explicitely set to `true`.\r\n\r\nNo test because there is no way to detect that a type has escaped, this might be something that could be added to `TreeChecker`.\r\n\r\n<hr>\r\n\r\nThis PR also removes dead code from `Typer#escapingRefs`.\r\n\r\n<hr>\r\n\r\nReview by @odersky ."},"comment":{"url":"https://api.github.com/repos/lampepfl/dotty/issues/comments/128158405","html_url":"https://github.com/lampepfl/dotty/pull/749#issuecomment-128158405","issue_url":"https://api.github.com/repos/lampepfl/dotty/issues/749","id":128158405,"user":{"login":"odersky","id":795990,"avatar_url":"https://avatars.githubusercontent.com/u/795990?v=3","gravatar_id":"","url":"https://api.github.com/users/odersky","html_url":"https://github.com/odersky","followers_url":"https://api.github.com/users/odersky/followers","following_url":"https://api.github.com/users/odersky/following{/other_user}","gists_url":"https://api.github.com/users/odersky/gists{/gist_id}","starred_url":"https://api.github.com/users/odersky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odersky/subscriptions","organizations_url":"https://api.github.com/users/odersky/orgs","repos_url":"https://api.github.com/users/odersky/repos","events_url":"https://api.github.com/users/odersky/events{/privacy}","received_events_url":"https://api.github.com/users/odersky/received_events","type":"User","site_admin":false},"created_at":"2015-08-05T21:44:30Z","updated_at":"2015-08-05T21:44:30Z","body":"In fact, given the observed failure of implicits, I would revert completely. Implicits should be searched in lower as well as upper bounds. So NamedParts can be reverted to use both bounds.\r\n"}}