{"action":"created","issue":{"url":"https://api.github.com/repos/lampepfl/dotty/issues/3989","repository_url":"https://api.github.com/repos/lampepfl/dotty","labels_url":"https://api.github.com/repos/lampepfl/dotty/issues/3989/labels{/name}","comments_url":"https://api.github.com/repos/lampepfl/dotty/issues/3989/comments","events_url":"https://api.github.com/repos/lampepfl/dotty/issues/3989/events","html_url":"https://github.com/lampepfl/dotty/issues/3989","id":296460113,"number":3989,"title":"Unsoundness when inheriting conflicting type parameters","user":{"login":"szeiger","id":54262,"avatar_url":"https://avatars3.githubusercontent.com/u/54262?v=4","gravatar_id":"","url":"https://api.github.com/users/szeiger","html_url":"https://github.com/szeiger","followers_url":"https://api.github.com/users/szeiger/followers","following_url":"https://api.github.com/users/szeiger/following{/other_user}","gists_url":"https://api.github.com/users/szeiger/gists{/gist_id}","starred_url":"https://api.github.com/users/szeiger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szeiger/subscriptions","organizations_url":"https://api.github.com/users/szeiger/orgs","repos_url":"https://api.github.com/users/szeiger/repos","events_url":"https://api.github.com/users/szeiger/events{/privacy}","received_events_url":"https://api.github.com/users/szeiger/received_events","type":"User","site_admin":false},"labels":[{"id":288606644,"url":"https://api.github.com/repos/lampepfl/dotty/labels/area:typer","name":"area:typer","color":"006b75","default":false},{"id":21379537,"url":"https://api.github.com/repos/lampepfl/dotty/labels/itype:bug","name":"itype:bug","color":"cc317c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-02-12T17:27:19Z","updated_at":"2018-02-15T12:11:36Z","closed_at":null,"author_association":"NONE","body":"This compiles without warnings in both Dotty master and Scala 2.12:\r\n\r\n```scala\r\ntrait A[+X]\r\ncase class B[X](x: X) extends A[X]\r\nclass C[X](x: Any) extends B[Any](x) with A[X]\r\ndef f(a: A[Int]): Int = a match {\r\n  case B(i) => i\r\n  case _ => 0\r\n}\r\nf(new C[Int](\"foo\"))\r\n```\r\n\r\nThere used to be unsoundness warnings but they are gone since (presumably) https://github.com/lampepfl/dotty/issues/3918 even though the pattern match is unsound.\r\n\r\nFurthermore the following compiles without warnings:\r\n\r\n```scala\r\ntrait A[+X] { def get: X }\r\ncase class B[X](x: X) extends A[X] { def get: X = x }\r\nclass C[X](x: Any) extends B[Any](x) with A[X]\r\ndef g(a: A[Int]): Int = a.get\r\ng(new C[Int](\"foo\"))\r\n```\r\n\r\nIn this case, which doesn't rely on pattern matching, the definition of `C` itself is unsound but Dotty accepts it anyway. Scala 2.12 rightfully complains:\r\n\r\n```\r\nscala> class C[X](x: Any) extends B[Any](x) with A[X]\r\n<console>:14: error: overriding method get in trait A of type => X;\r\n method get in class B of type => Any has incompatible type\r\n       class C[X](x: Any) extends B[Any](x) with A[X]\r\n             ^\r\n```"},"comment":{"url":"https://api.github.com/repos/lampepfl/dotty/issues/comments/365909265","html_url":"https://github.com/lampepfl/dotty/issues/3989#issuecomment-365909265","issue_url":"https://api.github.com/repos/lampepfl/dotty/issues/3989","id":365909265,"user":{"login":"Blaisorblade","id":289960,"avatar_url":"https://avatars3.githubusercontent.com/u/289960?v=4","gravatar_id":"","url":"https://api.github.com/users/Blaisorblade","html_url":"https://github.com/Blaisorblade","followers_url":"https://api.github.com/users/Blaisorblade/followers","following_url":"https://api.github.com/users/Blaisorblade/following{/other_user}","gists_url":"https://api.github.com/users/Blaisorblade/gists{/gist_id}","starred_url":"https://api.github.com/users/Blaisorblade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Blaisorblade/subscriptions","organizations_url":"https://api.github.com/users/Blaisorblade/orgs","repos_url":"https://api.github.com/users/Blaisorblade/repos","events_url":"https://api.github.com/users/Blaisorblade/events{/privacy}","received_events_url":"https://api.github.com/users/Blaisorblade/received_events","type":"User","site_admin":false},"created_at":"2018-02-15T12:11:36Z","updated_at":"2018-02-15T12:11:36Z","author_association":"CONTRIBUTOR","body":"Finally found the old discussion on covariant type refinement for members. Back then it was unclear whether the expressiveness loss was tolerable. No clue how all this has evolved.\r\nhttps://github.com/scala/bug/issues/7093#issuecomment-292418481"}}
{"actor":{"display_login":"Blaisorblade"}}