Skip to content

Commit

Permalink
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/src/main/java/org/jruby/RubyComplex.java
Original file line number Diff line number Diff line change
@@ -477,8 +477,12 @@ private static IRubyObject convertCommon(ThreadContext context, IRubyObject recv
}

if (a2.isNil()) {
if (a1 instanceof RubyNumeric && !f_real_p(context, a1).isTrue()) return a1;
if (singleArg && responds_to_to_c(context, a1) ) return a1.callMethod(context, "to_c");
if (a1 instanceof RubyNumeric) {
if (!f_real_p(context, a1).isTrue()) return a1;
}
else if (singleArg && ! a1.isNil() && responds_to_to_c(context, a1)) {
return a1.callMethod(context, "to_c");
}
return newInstance(context, recv, a1);
} else {
if (a1 instanceof RubyNumeric && a2 instanceof RubyNumeric &&

0 comments on commit bc9abda

Please sign in to comment.