{"action":"created","issue":{"url":"https://api.github.com/repos/ponylang/ponyc/issues/1328","repository_url":"https://api.github.com/repos/ponylang/ponyc","labels_url":"https://api.github.com/repos/ponylang/ponyc/issues/1328/labels{/name}","comments_url":"https://api.github.com/repos/ponylang/ponyc/issues/1328/comments","events_url":"https://api.github.com/repos/ponylang/ponyc/issues/1328/events","html_url":"https://github.com/ponylang/ponyc/issues/1328","id":183276309,"number":1328,"title":"Refcap violation via gencap-constrained type parameter.","user":{"login":"Praetonus","id":5193706,"avatar_url":"https://avatars.githubusercontent.com/u/5193706?v=3","gravatar_id":"","url":"https://api.github.com/users/Praetonus","html_url":"https://github.com/Praetonus","followers_url":"https://api.github.com/users/Praetonus/followers","following_url":"https://api.github.com/users/Praetonus/following{/other_user}","gists_url":"https://api.github.com/users/Praetonus/gists{/gist_id}","starred_url":"https://api.github.com/users/Praetonus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Praetonus/subscriptions","organizations_url":"https://api.github.com/users/Praetonus/orgs","repos_url":"https://api.github.com/users/Praetonus/repos","events_url":"https://api.github.com/users/Praetonus/events{/privacy}","received_events_url":"https://api.github.com/users/Praetonus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ponylang/ponyc/labels/bug:%201%20-%20needs%20investigation","name":"bug: 1 - needs investigation","color":"f7c6c7"},{"url":"https://api.github.com/repos/ponylang/ponyc/labels/needs%20discussion%20during%20sync","name":"needs discussion during sync","color":"0052cc"},{"url":"https://api.github.com/repos/ponylang/ponyc/labels/priority:%203%20-%20high","name":"priority: 3 - high","color":"006b75"}],"state":"open","locked":false,"assignee":{"login":"jemc","id":4623870,"avatar_url":"https://avatars.githubusercontent.com/u/4623870?v=3","gravatar_id":"","url":"https://api.github.com/users/jemc","html_url":"https://github.com/jemc","followers_url":"https://api.github.com/users/jemc/followers","following_url":"https://api.github.com/users/jemc/following{/other_user}","gists_url":"https://api.github.com/users/jemc/gists{/gist_id}","starred_url":"https://api.github.com/users/jemc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jemc/subscriptions","organizations_url":"https://api.github.com/users/jemc/orgs","repos_url":"https://api.github.com/users/jemc/repos","events_url":"https://api.github.com/users/jemc/events{/privacy}","received_events_url":"https://api.github.com/users/jemc/received_events","type":"User","site_admin":false},"assignees":[{"login":"jemc","id":4623870,"avatar_url":"https://avatars.githubusercontent.com/u/4623870?v=3","gravatar_id":"","url":"https://api.github.com/users/jemc","html_url":"https://github.com/jemc","followers_url":"https://api.github.com/users/jemc/followers","following_url":"https://api.github.com/users/jemc/following{/other_user}","gists_url":"https://api.github.com/users/jemc/gists{/gist_id}","starred_url":"https://api.github.com/users/jemc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jemc/subscriptions","organizations_url":"https://api.github.com/users/jemc/orgs","repos_url":"https://api.github.com/users/jemc/repos","events_url":"https://api.github.com/users/jemc/events{/privacy}","received_events_url":"https://api.github.com/users/jemc/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-10-16T16:36:07Z","updated_at":"2016-10-16T17:23:59Z","closed_at":null,"body":"```pony\r\nclass Foo\r\n  var i: USize = 0\r\n  fun ref boom() => i = 3\r\n\r\nactor Main\r\n  new create(env: Env) =>\r\n    let a: Foo val = Foo\r\n    env.out.print(a.i.string())\r\n    bla[Foo val](a)\r\n    env.out.print(a.i.string())\r\n   \r\n  fun bla[A: Foo #read](x: A) =>\r\n    x.boom()\r\n```\r\n\r\nThis compiles fine and prints 0 then 3. The `val` object was indeed modified."},"comment":{"url":"https://api.github.com/repos/ponylang/ponyc/issues/comments/254060416","html_url":"https://github.com/ponylang/ponyc/issues/1328#issuecomment-254060416","issue_url":"https://api.github.com/repos/ponylang/ponyc/issues/1328","id":254060416,"user":{"login":"jemc","id":4623870,"avatar_url":"https://avatars.githubusercontent.com/u/4623870?v=3","gravatar_id":"","url":"https://api.github.com/users/jemc","html_url":"https://github.com/jemc","followers_url":"https://api.github.com/users/jemc/followers","following_url":"https://api.github.com/users/jemc/following{/other_user}","gists_url":"https://api.github.com/users/jemc/gists{/gist_id}","starred_url":"https://api.github.com/users/jemc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jemc/subscriptions","organizations_url":"https://api.github.com/users/jemc/orgs","repos_url":"https://api.github.com/users/jemc/repos","events_url":"https://api.github.com/users/jemc/events{/privacy}","received_events_url":"https://api.github.com/users/jemc/received_events","type":"User","site_admin":false},"created_at":"2016-10-16T17:23:59Z","updated_at":"2016-10-16T17:23:59Z","body":"FYI this works exactly the same way (broken) when using type parameters on a type instead of on a method (when `fun bla` is converted to `primitive Bla fun apply`):\r\n\r\n```pony\r\nclass Foo\r\n  var i: USize = 0\r\n  fun ref boom() => i = 3\r\n\r\nprimitive Bla[A: Foo #read]\r\n  fun apply(x: A) =>\r\n    x.boom()\r\n\r\nactor Main\r\n  new create(env: Env) =>\r\n    let a: Foo val = Foo\r\n    env.out.print(a.i.string())\r\n    Bla[Foo val](a)\r\n    env.out.print(a.i.string())\r\n```"}}
{"actor":{"display_login":"jemc"}}