{"action":"opened","issue":{"url":"https://api.github.com/repos/jruby/jruby/issues/3599","labels_url":"https://api.github.com/repos/jruby/jruby/issues/3599/labels{/name}","comments_url":"https://api.github.com/repos/jruby/jruby/issues/3599/comments","events_url":"https://api.github.com/repos/jruby/jruby/issues/3599/events","html_url":"https://github.com/jruby/jruby/issues/3599","id":126437081,"number":3599,"title":"jrubyc won't compile a file with method in outer scope (NoMethodError: undefined method `new_method' for nil:NilClass)","user":{"login":"ruskotron","id":1484770,"avatar_url":"https://avatars.githubusercontent.com/u/1484770?v=3","gravatar_id":"","url":"https://api.github.com/users/ruskotron","html_url":"https://github.com/ruskotron","followers_url":"https://api.github.com/users/ruskotron/followers","following_url":"https://api.github.com/users/ruskotron/following{/other_user}","gists_url":"https://api.github.com/users/ruskotron/gists{/gist_id}","starred_url":"https://api.github.com/users/ruskotron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruskotron/subscriptions","organizations_url":"https://api.github.com/users/ruskotron/orgs","repos_url":"https://api.github.com/users/ruskotron/repos","events_url":"https://api.github.com/users/ruskotron/events{/privacy}","received_events_url":"https://api.github.com/users/ruskotron/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-13T14:59:49Z","updated_at":"2016-01-13T14:59:49Z","closed_at":null,"body":"\r\nLooking at the example at https://github.com/jruby/jruby/wiki/JRubyCompiler\r\n\r\nThis should be possible i.e.\r\n\r\n    def my_method\r\n      puts 'splat'\r\n    end\r\n    \r\n    my_method\r\n\r\nresults in a error like this from jrubyc:\r\n\r\n     $ java -jar tools/jruby-complete-9.0.4.0.jar -S jrubyc --verbose --javac outer.rb\r\n    NoMethodError: undefined method `new_method' for nil:NilClass\r\n                               new_method at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/jruby/compiler/java_class.rb:115\r\n                 block in ClassNodeWalker at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/jruby/compiler/java_class.rb:239\r\n     .. and so on ...\r\n\r\nThis works fine when executed as a script e.g. \r\n\r\n     $ java -jar tools/jruby-complete-9.0.4.0.jar  outer.rb\r\n    splat\r\n\r\n"}}