summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-enum-ext/mrblib/enum.rb
diff options
context:
space:
mode:
Diffstat (limited to 'mrbgems/mruby-enum-ext/mrblib/enum.rb')
-rw-r--r--mrbgems/mruby-enum-ext/mrblib/enum.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/mrbgems/mruby-enum-ext/mrblib/enum.rb b/mrbgems/mruby-enum-ext/mrblib/enum.rb
index 96249db28..b4ac67a5b 100644
--- a/mrbgems/mruby-enum-ext/mrblib/enum.rb
+++ b/mrbgems/mruby-enum-ext/mrblib/enum.rb
@@ -768,7 +768,12 @@ module Enumerable
def zip(*arg, &block)
result = block ? nil : []
- arg = arg.map{|a|a.to_a}
+ arg = arg.map do |a|
+ unless a.respond_to?(:to_a)
+ raise TypeError, "wrong argument type #{a.class} (must respond to :to_a)"
+ end
+ a.to_a
+ end
i = 0
self.each do |*val|