Why does string + fixnum addition generate coercion error?
ruby
Solution
Because ruby doesn't know whether you want to convert the string to int or the int to string. In e.g. java `1 + "3"` is `"13"`. Ruby prefers to raise an error, so that the user can decide whether to `to_s` the one operand or `to_i` the other, rather than doing the wrong thing automatically.
Problem
Why does ruby addition cannot coerce given string to fixnum and vice verca? ``` irb>fixnum = 1 => 1 irb> fixnum.class => Fixnum irb> string = "3" => "3" irb> string.class => String irb> string.to_i => 3 irb> fixnum + string TypeError: String can't be coerced into Fixnum from (irb):96:in `+' from (irb):96 from :0 irb(main):097:0> ```