{"action":"created","issue":{"url":"https://api.github.com/repos/ceylon/ceylon-compiler/issues/2239","labels_url":"https://api.github.com/repos/ceylon/ceylon-compiler/issues/2239/labels{/name}","comments_url":"https://api.github.com/repos/ceylon/ceylon-compiler/issues/2239/comments","events_url":"https://api.github.com/repos/ceylon/ceylon-compiler/issues/2239/events","html_url":"https://github.com/ceylon/ceylon-compiler/issues/2239","id":95861929,"number":2239,"title":"annotations on LOCAL_VARIABLE might \"capture\" the variable","user":{"login":"sgalles","id":153065,"avatar_url":"https://avatars.githubusercontent.com/u/153065?v=3","gravatar_id":"","url":"https://api.github.com/users/sgalles","html_url":"https://github.com/sgalles","followers_url":"https://api.github.com/users/sgalles/followers","following_url":"https://api.github.com/users/sgalles/following{/other_user}","gists_url":"https://api.github.com/users/sgalles/gists{/gist_id}","starred_url":"https://api.github.com/users/sgalles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgalles/subscriptions","organizations_url":"https://api.github.com/users/sgalles/orgs","repos_url":"https://api.github.com/users/sgalles/repos","events_url":"https://api.github.com/users/sgalles/events{/privacy}","received_events_url":"https://api.github.com/users/sgalles/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ceylon/ceylon-compiler/labels/annotations","name":"annotations","color":"207de5"},{"url":"https://api.github.com/repos/ceylon/ceylon-compiler/labels/BUG","name":"BUG","color":"e10c02"},{"url":"https://api.github.com/repos/ceylon/ceylon-compiler/labels/high%20priority","name":"high priority","color":"d7e102"},{"url":"https://api.github.com/repos/ceylon/ceylon-compiler/labels/interoperability","name":"interoperability","color":"875100"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/ceylon/ceylon-compiler/milestones/11","html_url":"https://github.com/ceylon/ceylon-compiler/milestones/1.2","labels_url":"https://api.github.com/repos/ceylon/ceylon-compiler/milestones/11/labels","id":809477,"number":11,"title":"1.2","description":"","creator":{"login":"tombentley","id":879487,"avatar_url":"https://avatars.githubusercontent.com/u/879487?v=3","gravatar_id":"","url":"https://api.github.com/users/tombentley","html_url":"https://github.com/tombentley","followers_url":"https://api.github.com/users/tombentley/followers","following_url":"https://api.github.com/users/tombentley/following{/other_user}","gists_url":"https://api.github.com/users/tombentley/gists{/gist_id}","starred_url":"https://api.github.com/users/tombentley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tombentley/subscriptions","organizations_url":"https://api.github.com/users/tombentley/orgs","repos_url":"https://api.github.com/users/tombentley/repos","events_url":"https://api.github.com/users/tombentley/events{/privacy}","received_events_url":"https://api.github.com/users/tombentley/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":314,"state":"open","created_at":"2014-10-01T08:51:07Z","updated_at":"2015-07-22T18:29:54Z","due_on":"2014-11-02T23:00:00Z","closed_at":null},"comments":9,"created_at":"2015-07-18T21:43:52Z","updated_at":"2015-07-23T14:03:40Z","closed_at":null,"body":"@tombentley this is motivated by this classical CDI idiom :\r\n```ceylon\r\nclass DatabaseProducer() {\r\n    persistenceContext__SETTER\r\n    produces__GETTER\r\n    late EntityManager em;\r\n}\r\n```\r\nThis does not compile\r\n```\r\nno target for persistenceContext__SETTER annotation: @Target of @interface PersistenceContext lists [SETTER] but annotated element tranforms to [LOCAL_VARIABLE]\r\nno target for produces__GETTER annotation: @Target of @interface Produces lists [GETTER] but annotated element tranforms to [LOCAL_VARIABLE]\r\n```\r\nTo make it compile I must either share `em`, or artificially use `em` in a method of `DatabaseProducer`"},"comment":{"url":"https://api.github.com/repos/ceylon/ceylon-compiler/issues/comments/124118100","html_url":"https://github.com/ceylon/ceylon-compiler/issues/2239#issuecomment-124118100","issue_url":"https://api.github.com/repos/ceylon/ceylon-compiler/issues/2239","id":124118100,"user":{"login":"tombentley","id":879487,"avatar_url":"https://avatars.githubusercontent.com/u/879487?v=3","gravatar_id":"","url":"https://api.github.com/users/tombentley","html_url":"https://github.com/tombentley","followers_url":"https://api.github.com/users/tombentley/followers","following_url":"https://api.github.com/users/tombentley/following{/other_user}","gists_url":"https://api.github.com/users/tombentley/gists{/gist_id}","starred_url":"https://api.github.com/users/tombentley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tombentley/subscriptions","organizations_url":"https://api.github.com/users/tombentley/orgs","repos_url":"https://api.github.com/users/tombentley/repos","events_url":"https://api.github.com/users/tombentley/events{/privacy}","received_events_url":"https://api.github.com/users/tombentley/received_events","type":"User","site_admin":false},"created_at":"2015-07-23T14:03:40Z","updated_at":"2015-07-23T14:03:40Z","body":"@FroMage using a compiler annotation like this is an abuse. They were always meant to be just for testing the typechecker and compiler with, never to use in real code. I think we need to find a different way."}}