{"action":"created","issue":{"url":"https://api.github.com/repos/lampepfl/dotty/issues/4442","repository_url":"https://api.github.com/repos/lampepfl/dotty","labels_url":"https://api.github.com/repos/lampepfl/dotty/issues/4442/labels{/name}","comments_url":"https://api.github.com/repos/lampepfl/dotty/issues/4442/comments","events_url":"https://api.github.com/repos/lampepfl/dotty/issues/4442/events","html_url":"https://github.com/lampepfl/dotty/issues/4442","id":319575353,"number":4442,"title":"Lambdas are not serialisable","user":{"login":"allanrenucci","id":4996324,"avatar_url":"https://avatars1.githubusercontent.com/u/4996324?v=4","gravatar_id":"","url":"https://api.github.com/users/allanrenucci","html_url":"https://github.com/allanrenucci","followers_url":"https://api.github.com/users/allanrenucci/followers","following_url":"https://api.github.com/users/allanrenucci/following{/other_user}","gists_url":"https://api.github.com/users/allanrenucci/gists{/gist_id}","starred_url":"https://api.github.com/users/allanrenucci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allanrenucci/subscriptions","organizations_url":"https://api.github.com/users/allanrenucci/orgs","repos_url":"https://api.github.com/users/allanrenucci/repos","events_url":"https://api.github.com/users/allanrenucci/events{/privacy}","received_events_url":"https://api.github.com/users/allanrenucci/received_events","type":"User","site_admin":false},"labels":[{"id":476966624,"url":"https://api.github.com/repos/lampepfl/dotty/labels/area:transform","name":"area:transform","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":0,"created_at":"2018-05-02T14:26:37Z","updated_at":"2018-05-02T14:32:05Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"```scala\r\nobject Test {\r\n  def serializeDeserialize[T <: AnyRef](obj: T): T = {\r\n    import java.io._\r\n    val buffer = new ByteArrayOutputStream\r\n    val out = new ObjectOutputStream(buffer)\r\n    out.writeObject(obj)\r\n    val in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray))\r\n    in.readObject.asInstanceOf[T]\r\n  }\r\n\r\n  def main(args: Array[String]): Unit = {\r\n    val adder = serializeDeserialize((x: Int) => x + 1)\r\n    assert(adder(1) == 2)\r\n  }\r\n}\r\n\r\n```\r\n```\r\n> dotc -d out Test.scala\r\n> dotr -classpath out Test\r\nException in thread \"main\" java.io.NotSerializableException: Test$$$Lambda$1/1023892928\r\n\tat java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)\r\n\tat java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)\r\n\tat Test$.serializeDeserialize(Test.scala:6)\r\n\tat Test$.main(Test.scala:12)\r\n\tat Test.main(Test.scala\r\n```"},"comment":{"url":"https://api.github.com/repos/lampepfl/dotty/issues/comments/385998326","html_url":"https://github.com/lampepfl/dotty/issues/4442#issuecomment-385998326","issue_url":"https://api.github.com/repos/lampepfl/dotty/issues/4442","id":385998326,"user":{"login":"smarter","id":63430,"avatar_url":"https://avatars2.githubusercontent.com/u/63430?v=4","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},"created_at":"2018-05-02T14:32:05Z","updated_at":"2018-05-02T14:32:05Z","author_association":"MEMBER","body":"This is a big piece of work, check for deserializeLambda in scalac to know more: https://github.com/scala/scala/search?utf8=%E2%9C%93&q=deserializeLambda&type="}}
{"actor":{"display_login":"smarter"}}