Skip to content

Commit

Permalink
Fix implicit coercion error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Oct 7, 2016
1 parent 43e9bb1 commit 34622de
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
Expand Up @@ -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();
Expand Down

0 comments on commit 34622de

Please sign in to comment.