-
Notifications
You must be signed in to change notification settings - Fork 154
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
[COMPILER] Compiling array within a hash #2015
Comments
If a hash has children that are not "basic" types of objects, then we can't consider the hash to be a static literal. Fixes: ruby#2015
@tenderlove @kddnewton , this is still a bug on the latest master. I don't think #2016 fixed it. |
There is a similar problem that exhibits itself with a similar message, which can be reproduced by: RubyVM::InstructionSequence.compile_prism(<<~RUBY).eval
def foo a: [], b: []
p a
p b
end
foo(a: [Symbol])
RUBY and it outputs:
Note that since the second optional param is not passed, it causes an error on the I found this by isolating it from the failure of |
Oh I think I know what's wrong with #2016. The PR checks if Now, So, none of our code actually makes the |
OK, I have what I think is a fix here: #2055 and a test that passes on ruby/ruby with that change here: ruby/ruby#9215 |
Minimal repro:
leads to
method
hash' called on hidden T_ARRAY object`Found from:
RUBY_ISEQ_DUMP_DEBUG=prism make test/coverage/test_coverage.rb
The text was updated successfully, but these errors were encountered: