Skip to content

Commit

Permalink
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion spec/truffle/tags/language/block_tags.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
fails:A block yielded a single Array assigns elements to required arguments when a keyword rest argument is present
fails:A block yielded a single Array assigns the last element to a non-keyword argument if #to_hash returns nil
fails:A block yielded a single Array calls #to_hash on the argument but does not use the result when no keywords are present
fails:A block yielded a single Array calls #to_hash on the last element when there are more arguments than parameters
6 changes: 6 additions & 0 deletions truffle/src/main/ruby/core/shims.rb
Original file line number Diff line number Diff line change
@@ -276,6 +276,12 @@ def self.load_arguments_from_array_kw_helper(array, kwrest_name, binding)

last_arg = array.pop
kwargs = last_arg.to_hash

if kwargs.nil?
array.push last_arg
return array
end

raise TypeError.new("can't convert #{last_arg.class} to Hash (#{last_arg.class}#to_hash gives #{kwargs.class})") unless kwargs.is_a?(Hash)

kwargs.select! do |key, value|

0 comments on commit 2e14199

Please sign in to comment.