{"action":"opened","issue":{"url":"https://api.github.com/repos/google/closure-compiler/issues/1182","labels_url":"https://api.github.com/repos/google/closure-compiler/issues/1182/labels{/name}","comments_url":"https://api.github.com/repos/google/closure-compiler/issues/1182/comments","events_url":"https://api.github.com/repos/google/closure-compiler/issues/1182/events","html_url":"https://github.com/google/closure-compiler/issues/1182","id":109638719,"number":1182,"title":"@enum fails under @lends with NPE?","user":{"login":"woldie","id":10250336,"avatar_url":"https://avatars.githubusercontent.com/u/10250336?v=3","gravatar_id":"","url":"https://api.github.com/users/woldie","html_url":"https://github.com/woldie","followers_url":"https://api.github.com/users/woldie/followers","following_url":"https://api.github.com/users/woldie/following{/other_user}","gists_url":"https://api.github.com/users/woldie/gists{/gist_id}","starred_url":"https://api.github.com/users/woldie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woldie/subscriptions","organizations_url":"https://api.github.com/users/woldie/orgs","repos_url":"https://api.github.com/users/woldie/repos","events_url":"https://api.github.com/users/woldie/events{/privacy}","received_events_url":"https://api.github.com/users/woldie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-03T18:45:28Z","updated_at":"2015-10-03T18:45:28Z","closed_at":null,"body":"I am seeing NullPointerExceptions when I do a @lends when extending a class with static members.  A workaround I found to avoid the NPE was to make the enum a top level type (not a static class member) or append the @enum to the class with a simple assignment rather than extends/@lends.\r\n\r\nI see the NPE on the current version of the CLI compiler at http://dl.google.com/closure-compiler/compiler-latest.zip and on the closure compiler appspot app.  Here's a link where you can see the NPE in action:\r\n\r\nhttp://closure-compiler.appspot.com/home#code%3D%252F%252F%2520%253D%253DClosureCompiler%253D%253D%250A%252F%252F%2520%2540compilation_level%2520ADVANCED_OPTIMIZATIONS%250A%252F%252F%2520%2540output_file_name%2520default.js%250A%252F%252F%2520%2540formatting%2520pretty_print%250A%252F%252F%2520%253D%253D%252FClosureCompiler%253D%253D%250A%250A%252F%252F%2520ADD%2520YOUR%2520CODE%2520HERE%250Afunction%2520extend(obj%252C%2520extendWith)%2520%257B%250A%2520%2520var%2520prop%253B%250A%250A%2520%2520%252F%252F%2520jshint%2520-W116%250A%2520%2520if(obj%2520%2526%2526%2520extendWith%2520%2526%2526%2520obj%2520!%253D%2520extendWith)%2520%257B%250A%2520%2520%2520%2520for(prop%2520in%2520extendWith)%2520%257B%250A%2520%2520%2520%2520%2520%2520if(extendWith.hasOwnProperty(prop))%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520obj%255Bprop%255D%2520%253D%2520extendWith%255Bprop%255D%253B%250A%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%257D%250A%2520%2520%257D%250A%257D%250A%250A%252F**%250A%2520*%2520%2540constructor%250A%2520*%252F%250Afunction%2520MyClass()%2520%257B%250A%257D%250A%250Aextend(MyClass%252C%2520%252F**%2520%2540lends%2520%257BMyClass%257D%2520*%252F%2520%257B%2520%250A%2520%2520%252F**%2520%2540enum%2520%257Bnumber%257D%2520*%252F%250A%2520%2520MyEnum%253A%2520%257B%250A%2520%2520%2520%2520VALUE_1%253A%25201%252C%250A%2520%2520%2520%2520VALUE_2%253A%25202%250A%2520%2520%257D%250A%257D)%253B%250A%250A%252F**%250A%2520*%2520%2540param%2520%257BMyClass.MyEnum%257D%2520enumValue%250A%2520*%252F%250AMyClass.prototype.memberFunction%2520%253D%2520function(enumValue)%2520%257B%250A%2520%2520console.log(%2522memberFunction%2520%2522%2520%252B%2520enumValue)%253B%250A%257D%253B%250A%250Avar%2520myObject%2520%253D%2520new%2520MyClass()%253B%250A%250AmyObject.memberFunction(MyClass.MyEnum.VALUE_2)%253B%250A%250A "}}