We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Provide at least:
When prepending a module which just calls super on the Struct, the first attribute gets initialized wrong:
klass = Struct.new(:runner_type, :output_type, keyword_init: true) # correct output puts klass.new({}) # -> #<struct runner_type=nil, output_type=nil> klass.prepend(Module.new { def initialize(**options) puts options.inspect super(options) end }) # wrong output -> runner_type is initialized to {} puts klass.new({}) # -> #<struct runner_type={}, output_type=nil>
The output should be the same.
The second call uses https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/RubyStruct.java#L399 instead of https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/RubyStruct.java#L354. Looking at the code, the same initializer should be used, no?
The text was updated successfully, but these errors were encountered:
The code is adopted from https://github.com/benchmark-driver/benchmark-driver which uses it to generate a Config struct. benchmark-driver is basically broken for JRuby because of this issue.
Sorry, something went wrong.
26f84cc
Tested the fix, works for me! Thanks for the quick fix ❤️
No branches or pull requests
Environment
Provide at least:
Expected Behavior
When prepending a module which just calls super on the Struct, the first attribute gets initialized wrong:
Actual Behavior
The output should be the same.
The second call uses https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/RubyStruct.java#L399 instead of https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/RubyStruct.java#L354. Looking at the code, the same initializer should be used, no?
The text was updated successfully, but these errors were encountered: