From: Matthew Bloch Date: 2002-07-26T07:38:46+09:00 Subject: Re: A couple of questions on writing extensions On Thursday 25 July 2002 22:09, Matthew Bloch wrote: > *) what does 'Died with exception wrong argument type Object (expected > Data)' mean? Isn't everything an object? Since converting a Ruby class to > C for performance reasons, while debugging, I've this exception raised at > random points in my program, e.g. reported as being thrown from the fairly > innocuous: > > key.gsub!(/\//, File::SEPARATOR) > > which is nothing to do with my converted class, but the error implies 'key' > is somehow corrupt or of the wrong type, where the same code worked before. > This exception seems to be thrown from different points depending on timing > (though more often than not in a simple call to a logger), which is pretty > difficult to track down. A bit more information: if I put a "print key.type" statement before & after this line, I see "String" twice, as expected, and the bug disappears and pops up at another point in the program, later on in the execution. I realise you've got to be careful writing native language extensions, but this is pretty weird :) -- Matthew > http://www.soup-kitchen.net/ > ICQ 19482073