{"action":"created","issue":{"url":"https://api.github.com/repos/grails/grails-core/issues/10374","repository_url":"https://api.github.com/repos/grails/grails-core","labels_url":"https://api.github.com/repos/grails/grails-core/issues/10374/labels{/name}","comments_url":"https://api.github.com/repos/grails/grails-core/issues/10374/comments","events_url":"https://api.github.com/repos/grails/grails-core/issues/10374/events","html_url":"https://github.com/grails/grails-core/issues/10374","id":197226527,"number":10374,"title":"GrailsCompileStatic causes getters to fail when calling to an interface wrapping a domain class.","user":{"login":"chriserickson","id":1971519,"avatar_url":"https://avatars.githubusercontent.com/u/1971519?v=3","gravatar_id":"","url":"https://api.github.com/users/chriserickson","html_url":"https://github.com/chriserickson","followers_url":"https://api.github.com/users/chriserickson/followers","following_url":"https://api.github.com/users/chriserickson/following{/other_user}","gists_url":"https://api.github.com/users/chriserickson/gists{/gist_id}","starred_url":"https://api.github.com/users/chriserickson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriserickson/subscriptions","organizations_url":"https://api.github.com/users/chriserickson/orgs","repos_url":"https://api.github.com/users/chriserickson/repos","events_url":"https://api.github.com/users/chriserickson/events{/privacy}","received_events_url":"https://api.github.com/users/chriserickson/received_events","type":"User","site_admin":false},"labels":[{"id":193679169,"url":"https://api.github.com/repos/grails/grails-core/labels/Not%20a%20Bug","name":"Not a Bug","color":"207de5","default":false}],"state":"closed","locked":false,"assignee":{"login":"jeffbrown","id":15482,"avatar_url":"https://avatars.githubusercontent.com/u/15482?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffbrown","html_url":"https://github.com/jeffbrown","followers_url":"https://api.github.com/users/jeffbrown/followers","following_url":"https://api.github.com/users/jeffbrown/following{/other_user}","gists_url":"https://api.github.com/users/jeffbrown/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffbrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffbrown/subscriptions","organizations_url":"https://api.github.com/users/jeffbrown/orgs","repos_url":"https://api.github.com/users/jeffbrown/repos","events_url":"https://api.github.com/users/jeffbrown/events{/privacy}","received_events_url":"https://api.github.com/users/jeffbrown/received_events","type":"User","site_admin":false},"assignees":[{"login":"jeffbrown","id":15482,"avatar_url":"https://avatars.githubusercontent.com/u/15482?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffbrown","html_url":"https://github.com/jeffbrown","followers_url":"https://api.github.com/users/jeffbrown/followers","following_url":"https://api.github.com/users/jeffbrown/following{/other_user}","gists_url":"https://api.github.com/users/jeffbrown/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffbrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffbrown/subscriptions","organizations_url":"https://api.github.com/users/jeffbrown/orgs","repos_url":"https://api.github.com/users/jeffbrown/repos","events_url":"https://api.github.com/users/jeffbrown/events{/privacy}","received_events_url":"https://api.github.com/users/jeffbrown/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2016-12-22T17:34:35Z","updated_at":"2016-12-27T14:00:07Z","closed_at":"2016-12-22T22:14:43Z","body":"Given an interface:\r\n```\r\ninterface SomeInterfaceForADomainClass {\r\n    String name\r\n}\r\n```\r\n\r\nA domain object:\r\n```\r\nclass DomainClass implements SomeInterfaceForADomainClass {\r\n    String name\r\n\r\n    static constraints = {\r\n    }\r\n}\r\n```\r\n\r\nAnd a class set to be statically compiled, which delegates to the interface:\r\n```\r\n@GrailsCompileStatic\r\nclass DomainClassWrapper {\r\n    private final SomeInterfaceForADomainClass someInterface\r\n\r\n    public DomainClassWrapper(SomeInterfaceForADomainClass someInterface) {\r\n        this.someInterface = someInterface\r\n    }\r\n\r\n    String getName() { someInterface.name }\r\n}\r\n```\r\n\r\nThe following test will fail:\r\n```\r\nclass BasicCompiledStaticTest extends Specification {\r\n     void \"sanity test\"() {\r\n        when:\r\n        def domain = new DomainClassWrapper(new DomainClass(name: \"Test\"))\r\n\r\n        println (\"Domain name: ${domain.name}\")\r\n\r\n        then:\r\n        domain.getName() == \"Test\" // returns null\r\n        domain.name == \"Test\" // returns null\r\n\r\n    }\r\n}\r\n```\r\n\r\nI did a similar test with `@CompileStatic` in groovy, and did not see the problem there.\r\n\r\n\r\n### Environment Information\r\n\r\n- **Operating System**: Windows 7 enterprise, SP1\r\n- **Grails Version:** 2.5.4\r\n- **JDK Version:** 1.8.0_112\r\n\r\n### Example Application\r\nI don't have git installed right now, so I'll just attach the project directly:\r\n[testGrailsCompileStatic.zip](https://github.com/grails/grails-core/files/669399/testGrailsCompileStatic.zip)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/grails/grails-core/issues/comments/269329786","html_url":"https://github.com/grails/grails-core/issues/10374#issuecomment-269329786","issue_url":"https://api.github.com/repos/grails/grails-core/issues/10374","id":269329786,"user":{"login":"jeffbrown","id":15482,"avatar_url":"https://avatars.githubusercontent.com/u/15482?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffbrown","html_url":"https://github.com/jeffbrown","followers_url":"https://api.github.com/users/jeffbrown/followers","following_url":"https://api.github.com/users/jeffbrown/following{/other_user}","gists_url":"https://api.github.com/users/jeffbrown/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffbrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffbrown/subscriptions","organizations_url":"https://api.github.com/users/jeffbrown/orgs","repos_url":"https://api.github.com/users/jeffbrown/repos","events_url":"https://api.github.com/users/jeffbrown/events{/privacy}","received_events_url":"https://api.github.com/users/jeffbrown/received_events","type":"User","site_admin":false},"created_at":"2016-12-27T14:00:07Z","updated_at":"2016-12-27T14:00:07Z","body":"@chriserickson That issue doesn't look like a bug to me but of course the Groovy team can sort that out and make a decision.  Thanks for the feedback."}}
{"actor":{"display_login":"jeffbrown"}}