https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17097754782013-05-15T07:55:21ZRuby Issue Tracking SystemRuby master - Bug #8407: *args in method_missing not typing variables correctlyhttps://bugs.ruby-lang.org/issues/8407?journal_id=393412013-05-15T07:55:21Zphluid61 (Matthew Kerwin)matthew@kerwin.net.au
<ul></ul><p>=begin<br>
Why do you keep referring to (({*args[0]})) in your code? I suspect the following is what you meant:</p>
<p>class Klass<br>
def method_missing(sym, *args, &block)<br>
puts args[0].inspect<br>
puts args[0].class<br>
mystring = args[0]<br>
puts mystring.class<br>
end<br>
end</p>
<p>a = Klass.new<br>
a.doThings("AmIAString?")</p>
<p>Unless you're explicitly referring to an issue around splatting a non-array?</p>
<p>Compare:<br>
x = *'a' #=> ['a']<br>
y = 'a' #=> 'a'<br>
=end</p> Ruby master - Bug #8407: *args in method_missing not typing variables correctlyhttps://bugs.ruby-lang.org/issues/8407?journal_id=393422013-05-15T09:24:32Zmatz (Yukihiro Matsumoto)matz@ruby.or.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li></ul><p>As, Matthew said, you misunderstand how '*' works.</p>
<p>Matz.</p> Ruby master - Bug #8407: *args in method_missing not typing variables correctlyhttps://bugs.ruby-lang.org/issues/8407?journal_id=393542013-05-15T22:21:52Zrcastro (Ryan Castro)rcastro@mastercontrol.com
<ul></ul><p>Yes, I clearly did. And now, this morning, my error stands out like a sore thumb.</p>
<p>Sorry to waste time.</p>