You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
String#+ with a non-String raises NoMethodError instead of TypeError #409
Found while writing the #391 fixtures (verified 2026-09-27 on 64326cb against CRuby 3.4.8).
begin;"s" + 1;rescue=>e;putse.class;end
output
CRuby 3.4.8
TypeError (no implicit conversion of Integer into String)
rubyrs
NoMethodError
It looks like String#+ tries to_str on its argument and lets the resulting NoMethodError escape, where it should convert that into TypeError. The same coercion path (rb_str_to_str / implicit to_str) is probably shared by other String methods (<<, concat, start_with?, ...) and should be checked with them. method_missing_lite_serve.rb uses nil + 1 for its deopt case instead of "s" + 1 because of this.
Activity