Skip to content

Commit

Permalink
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions core/src/main/java/org/jruby/util/TypeConverter.java
Original file line number Diff line number Diff line change
@@ -392,13 +392,11 @@ public static IRubyObject checkArrayType(IRubyObject self) {
return TypeConverter.convertToTypeWithCheck19(context, self, runtime.getArray(), sites(context).to_ary_checked);
}

public static IRubyObject handleUncoercibleObject(boolean raise, IRubyObject obj, RubyClass target) throws RaiseException {
if (raise) throw obj.getRuntime().newTypeError("can't convert " + typeAsString(obj) + " into " + target);

return obj.getRuntime().getNil();
public static IRubyObject handleUncoercibleObject(boolean raise, IRubyObject obj, RubyClass target) {
return handleImplicitlyUncoercibleObject(raise, obj, target);
}

public static IRubyObject handleImplicitlyUncoercibleObject(boolean raise, IRubyObject obj, RubyClass target) throws RaiseException {
public static IRubyObject handleImplicitlyUncoercibleObject(boolean raise, IRubyObject obj, RubyClass target) {
if (raise) throw obj.getRuntime().newTypeError("no implicit conversion of " + typeAsString(obj) + " into " + target);

return obj.getRuntime().getNil();

0 comments on commit 34622de

Please sign in to comment.