summaryrefslogtreecommitdiff
path: root/complex.c
diff options
context:
space:
mode:
Diffstat (limited to 'complex.c')
-rw-r--r--complex.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/complex.c b/complex.c
index ec60c00ed6..144a59d533 100644
--- a/complex.c
+++ b/complex.c
@@ -563,6 +563,9 @@ nucomp_f_complex(int argc, VALUE *argv, VALUE klass)
if (!NIL_P(opts)) {
raise = rb_opts_exception_p(opts, raise);
}
+ if (argc > 0 && CLASS_OF(a1) == rb_cComplex && a2 == Qundef) {
+ return a1;
+ }
return nucomp_convert(rb_cComplex, a1, a2, raise);
}