Revision: 2863 http://trac.macosforge.org/projects/ruby/changeset/2863 Author: lsansonetti@apple.com Date: 2009-10-19 20:29:23 -0700 (Mon, 19 Oct 2009) Log Message: ----------- when generating the default objc runtime signature for a pure ruby method, if it starts by 'set' let's use 'void' instead of 'id' Modified Paths: -------------- MacRuby/trunk/vm.cpp Modified: MacRuby/trunk/vm.cpp =================================================================== --- MacRuby/trunk/vm.cpp 2009-10-20 03:16:06 UTC (rev 2862) +++ MacRuby/trunk/vm.cpp 2009-10-20 03:29:23 UTC (rev 2863) @@ -1505,8 +1505,11 @@ strncpy(buf, informal_type->c_str(), buflen); } else { + // Generate an automatic signature, using 'id' (@) for all + // arguments. If the method name starts by 'set', we use 'void' + // (v) for the return value, otherwise we use 'id' (@). assert(oc_arity < buflen); - buf[0] = '@'; + buf[0] = strncmp(sel_getName(sel), "set", 3) == 0 ? 'v' : '@'; buf[1] = '@'; buf[2] = ':'; for (unsigned int i = 3; i < oc_arity; i++) {