diff options
| author | Jean Boussier <jean.boussier@gmail.com> | 2026-02-05 20:38:00 +0100 |
|---|---|---|
| committer | Benoit Daloze <eregontp@gmail.com> | 2026-02-07 10:06:36 +0100 |
| commit | d066b9e01ccb2260fac8b2580c10e73335c7c7db (patch) | |
| tree | ece08ae6b0309149e09a640a3b41537a6485ee13 /complex.c | |
| parent | 96d00640978d78ede1f5b2b63e422cfd1e849891 (diff) | |
Refactor type error to be more consistent
[Bug #21864]
Co-Authored-By: Benoit Daloze <eregontp@gmail.com>
Diffstat (limited to 'complex.c')
| -rw-r--r-- | complex.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -20,6 +20,7 @@ #include "internal/array.h" #include "internal/class.h" #include "internal/complex.h" +#include "internal/error.h" #include "internal/math.h" #include "internal/numeric.h" #include "internal/object.h" @@ -2411,7 +2412,7 @@ nucomp_convert(VALUE klass, VALUE a1, VALUE a2, int raise) { if (NIL_P(a1) || NIL_P(a2)) { if (!raise) return Qnil; - rb_raise(rb_eTypeError, "can't convert nil into Complex"); + rb_cant_convert(Qnil, "Complex"); } if (RB_TYPE_P(a1, T_STRING)) { |
