summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'error.c')
-rw-r--r--error.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/error.c b/error.c
index 1cdf4692f0..cb56c4e163 100644
--- a/error.c
+++ b/error.c
@@ -164,8 +164,9 @@ rb_check_type(x, t)
int t;
{
struct types *type = builtin_types;
+ int tt = TYPE(x);
- if (TYPE(x)!=(t)) {
+ if (tt != t) {
while (type->type >= 0) {
if (type->type == t) {
char *etype;
@@ -173,6 +174,9 @@ rb_check_type(x, t)
if (NIL_P(x)) {
etype = "nil";
}
+ else if (FIXNUM_P(x)) {
+ etype = "Fixnum";
+ }
else if (rb_special_const_p(x)) {
etype = RSTRING(obj_as_string(x))->ptr;
}