diff --git a/lib/vm/call_site.rb b/lib/vm/call_site.rb index 6f2662dc..272b44ac 100644 --- a/lib/vm/call_site.rb +++ b/lib/vm/call_site.rb @@ -20,7 +20,7 @@ module Vm raise "meta #{name} " if value.is_a? Boot::MetaClass function.receiver.move( into, value ) if value.register_symbol != function.receiver.register_symbol end - raise "function call '#{name}' has #{args.length} arguments, but function has #{function.args.length}" if args.length != function.args.length + raise "function call '#{args.inspect}' has #{args.length} arguments, but function has #{function.args.length}" if args.length != function.args.length args.each_with_index do |arg , index| if arg.is_a?(IntegerConstant) or arg.is_a?(StringConstant) function.args[index].load into , arg diff --git a/test/fragments/helper.rb b/test/fragments/helper.rb index 2eac4571..7071d3f4 100644 --- a/test/fragments/helper.rb +++ b/test/fragments/helper.rb @@ -26,6 +26,7 @@ module Fragments if part.is_a? Ast::FunctionExpression expr = part.compile( @object_space.context ) else + puts part.inspect if part.is_a? Hash expr = part.compile( @object_space.context ) end end diff --git a/test/fragments/test_list.rb b/test/fragments/test_list.rb new file mode 100644 index 00000000..774e2715 --- /dev/null +++ b/test/fragments/test_list.rb @@ -0,0 +1,64 @@ +require_relative 'helper' + +class TestList < MiniTest::Test + include Fragments + + def test_list_clas + @string_input = <