Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with super not passing params with IR #2033

Closed
nirvdrum opened this issue Oct 9, 2014 · 2 comments
Closed

Problem with super not passing params with IR #2033

nirvdrum opened this issue Oct 9, 2014 · 2 comments
Labels

Comments

@nirvdrum
Copy link
Contributor

nirvdrum commented Oct 9, 2014

Here's a simple test case reduced from a Rails 3.2 app:

$ cat super_problem.rb 
module ActiveSupport
  module Dependencies
    extend self

    module Loadable
      def load_dependency(file)
        yield
      rescue Exception => e
        raise
      end

      def require(file)
        result = false
        load_dependency(file) { result = super }
        result
      end
    end
  end
end

include ActiveSupport::Dependencies::Loadable
require 'yaml'

Error:

$ ruby super_problem.rb 
ArgumentError: wrong number of arguments (0 for 1)
          require at /home/nirvdrum/.rbenv/versions/jruby-9000.dev-SNAPSHOT/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:14
          require at super_problem.rb:14
  load_dependency at super_problem.rb:7
          require at super_problem.rb:14
           (root) at super_problem.rb:22

Expected: No output. The YAML lib should just load.

Ruby version:

$ ruby -v
jruby 9000.dev-SNAPSHOT (2.1.2p142) 2014-10-09 c72837d Java HotSpot(TM) 64-Bit Server VM 25.20-b23 on 1.8.0_20-b26 [linux-amd64]
@enebo
Copy link
Member

enebo commented Oct 26, 2014

@nirvdrum I believe this has now been fixed. Your test script now works for me.

@nirvdrum
Copy link
Contributor Author

Yeah. My specs have been passing for a while now. Closing this one. Thanks!

@subbuss subbuss added the ir label Jan 15, 2015
@enebo enebo added this to the 9.0.0.0.pre2 milestone Jan 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants