mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Inspect dynamic symbol as well as static symbol
This commit is contained in:
parent
b341e98b04
commit
5decf66ab3
2 changed files with 5 additions and 1 deletions
|
@ -410,7 +410,7 @@ NORETURN(static void coerce_failed(VALUE x, VALUE y));
|
|||
static void
|
||||
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);
|
||||
}
|
||||
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, /:\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]'
|
||||
exp = "1.2 can't be coerced into Integer"
|
||||
|
|
Loading…
Add table
Reference in a new issue