if (obj instanceof RubyFixnum || obj instanceof RubySymbol) {
throw runtime.newTypeError("can't define singleton method \"" + name + "\" for " + obj.getMetaClass().getBaseName());
}
if (obj.isFrozen()) throw runtime.newFrozenError("object");
RubyClass rubyClass = obj.getSingletonClass();
rubyClass.addMethod(name, new InterpretedIRMethod(method, Visibility.PUBLIC, rubyClass));
obj.callMethod(context, "singleton_method_added", runtime.fastNewSymbol(name));