{"action":"closed","issue":{"url":"https://api.github.com/repos/flix/flix/issues/528","repository_url":"https://api.github.com/repos/flix/flix","labels_url":"https://api.github.com/repos/flix/flix/issues/528/labels{/name}","comments_url":"https://api.github.com/repos/flix/flix/issues/528/comments","events_url":"https://api.github.com/repos/flix/flix/issues/528/events","html_url":"https://github.com/flix/flix/issues/528","id":251428031,"number":528,"title":"[Backend] Introduce Phase for Defs","user":{"login":"magnus-madsen","id":2287953,"avatar_url":"https://avatars2.githubusercontent.com/u/2287953?v=4","gravatar_id":"","url":"https://api.github.com/users/magnus-madsen","html_url":"https://github.com/magnus-madsen","followers_url":"https://api.github.com/users/magnus-madsen/followers","following_url":"https://api.github.com/users/magnus-madsen/following{/other_user}","gists_url":"https://api.github.com/users/magnus-madsen/gists{/gist_id}","starred_url":"https://api.github.com/users/magnus-madsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magnus-madsen/subscriptions","organizations_url":"https://api.github.com/users/magnus-madsen/orgs","repos_url":"https://api.github.com/users/magnus-madsen/repos","events_url":"https://api.github.com/users/magnus-madsen/events{/privacy}","received_events_url":"https://api.github.com/users/magnus-madsen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"FlaminGuy","id":7500469,"avatar_url":"https://avatars3.githubusercontent.com/u/7500469?v=4","gravatar_id":"","url":"https://api.github.com/users/FlaminGuy","html_url":"https://github.com/FlaminGuy","followers_url":"https://api.github.com/users/FlaminGuy/followers","following_url":"https://api.github.com/users/FlaminGuy/following{/other_user}","gists_url":"https://api.github.com/users/FlaminGuy/gists{/gist_id}","starred_url":"https://api.github.com/users/FlaminGuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FlaminGuy/subscriptions","organizations_url":"https://api.github.com/users/FlaminGuy/orgs","repos_url":"https://api.github.com/users/FlaminGuy/repos","events_url":"https://api.github.com/users/FlaminGuy/events{/privacy}","received_events_url":"https://api.github.com/users/FlaminGuy/received_events","type":"User","site_admin":false},"assignees":[{"login":"FlaminGuy","id":7500469,"avatar_url":"https://avatars3.githubusercontent.com/u/7500469?v=4","gravatar_id":"","url":"https://api.github.com/users/FlaminGuy","html_url":"https://github.com/FlaminGuy","followers_url":"https://api.github.com/users/FlaminGuy/followers","following_url":"https://api.github.com/users/FlaminGuy/following{/other_user}","gists_url":"https://api.github.com/users/FlaminGuy/gists{/gist_id}","starred_url":"https://api.github.com/users/FlaminGuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FlaminGuy/subscriptions","organizations_url":"https://api.github.com/users/FlaminGuy/orgs","repos_url":"https://api.github.com/users/FlaminGuy/repos","events_url":"https://api.github.com/users/FlaminGuy/events{/privacy}","received_events_url":"https://api.github.com/users/FlaminGuy/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2017-08-19T14:19:49Z","updated_at":"2017-12-14T08:47:28Z","closed_at":"2017-12-14T08:47:28Z","author_association":"OWNER","body":"Implement a new phase `DefGen` to introduce a collection of classes for every function in the program:\r\n\r\nFor example, given the Flix program:\r\n\r\n```scala\r\ndef f(x: Int): Bool = x == 0\r\n\r\nnamespace Abcd {\r\n  def g(x: Bool): Option[Int] = if (x) None else Some(42)\r\n}\r\n```\r\n\r\nemit the Java classes:\r\n\r\n```java\r\nfinal class Def$f implements Fn1$Int$Bool {\r\n  private int arg0;\r\n  private boolean result0;\r\n  final int getArg0() { return this.arg0; }\r\n  final void setArg0(int arg) { this.arg0 = arg; }\r\n  boolean getResult();\r\n  void setResult(boolean res) { this.result = res; }\r\n  void apply(Global g) {\r\n    this.result = this.arg0 == 0;\r\n  }\r\n}\r\n```\r\n\r\n```java\r\npackage Abcd\r\nfinal class Def$g implements Fn1$Bool$Obj {\r\n  private boolean arg0;\r\n  private Object result0;\r\n  final boolean getArg0() { return this.arg0; }\r\n  final void setArg0(boolean arg) { this.arg0 = arg; }\r\n  Object getResult();\r\n  void setResult(Object res) { this.result = res; }\r\n  void apply(Global g) {\r\n    if (this.arg0) {\r\n      this.result = ...\r\n    } else {\r\n      this.result = ...\r\n    }\r\n  }\r\n} \r\n```\r\n\r\n(which goes in the java package `Abcd`.)\r\n\r\n\r\n__to be expanded__"}}
{"actor":{"display_login":"magnus-madsen"}}