{"action":"opened","issue":{"url":"https://api.github.com/repos/lampepfl/dotty/issues/533","labels_url":"https://api.github.com/repos/lampepfl/dotty/issues/533/labels{/name}","comments_url":"https://api.github.com/repos/lampepfl/dotty/issues/533/comments","events_url":"https://api.github.com/repos/lampepfl/dotty/issues/533/events","html_url":"https://github.com/lampepfl/dotty/issues/533","id":73058415,"number":533,"title":"fix handing of the java type T[]","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":0,"created_at":"2015-05-04T15:55:40Z","updated_at":"2015-05-04T15:55:40Z","closed_at":null,"body":"`JA.java`:\r\n```java\r\nclass JA {\r\n  public static <T> T get(T[] arr) {\r\n    return arr[0];\r\n  }\r\n}\r\n```\r\n`Compat.scala`:\r\n```scala\r\nobject Compat {\r\n  def main(args: Array[String]): Unit = {\r\n    val x = new Array[Int](1)\r\n    x(0) = 10\r\n    println(JA.get(x))\r\n  }\r\n}\r\n```\r\nThis should output an error since `T[]` is erased to `Object[]` but it compiles fine, for comparison, `scalac` will complain with:\r\n```scala\r\nCompat.scala:5: error: type mismatch;\r\n found   : Array[Int]\r\n required: Array[? with Object]\r\nNote: Int >: ? with Object, but class Array is invariant in type T.\r\nYou may wish to investigate a wildcard type such as `_ >: ? with Object`. (SLS 3.2.10)\r\n    println(JA.get(x))\r\n                   ^\r\none error found\r\n```"}}