Inspect dynamic symbol as well as static symbol
This commit is contained in:
parent
b341e98b04
commit
5decf66ab3
@ -410,7 +410,7 @@ NORETURN(static void coerce_failed(VALUE x, VALUE y));
|
|||||||
static void
|
static void
|
||||||
coerce_failed(VALUE x, VALUE y)
|
coerce_failed(VALUE x, VALUE y)
|
||||||
{
|
{
|
||||||
if (SPECIAL_CONST_P(y) || BUILTIN_TYPE(y) == T_FLOAT) {
|
if (SPECIAL_CONST_P(y) || SYMBOL_P(y) || RB_FLOAT_TYPE_P(y)) {
|
||||||
y = rb_inspect(y);
|
y = rb_inspect(y);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -26,6 +26,10 @@ class TestNumeric < Test::Unit::TestCase
|
|||||||
assert_raise_with_message(TypeError, /:"\\u3042"/) {1&:"\u{3042}"}
|
assert_raise_with_message(TypeError, /:"\\u3042"/) {1&:"\u{3042}"}
|
||||||
assert_raise_with_message(TypeError, /:"\\u3042"/) {1|:"\u{3042}"}
|
assert_raise_with_message(TypeError, /:"\\u3042"/) {1|:"\u{3042}"}
|
||||||
assert_raise_with_message(TypeError, /:"\\u3042"/) {1^:"\u{3042}"}
|
assert_raise_with_message(TypeError, /:"\\u3042"/) {1^:"\u{3042}"}
|
||||||
|
assert_raise_with_message(TypeError, /:\u{3044}/) {1+"\u{3044}".to_sym}
|
||||||
|
assert_raise_with_message(TypeError, /:\u{3044}/) {1&"\u{3044}".to_sym}
|
||||||
|
assert_raise_with_message(TypeError, /:\u{3044}/) {1|"\u{3044}".to_sym}
|
||||||
|
assert_raise_with_message(TypeError, /:\u{3044}/) {1^"\u{3044}".to_sym}
|
||||||
|
|
||||||
bug10711 = '[ruby-core:67405] [Bug #10711]'
|
bug10711 = '[ruby-core:67405] [Bug #10711]'
|
||||||
exp = "1.2 can't be coerced into Integer"
|
exp = "1.2 can't be coerced into Integer"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user