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
Be sure to define to_s(io : IO) : Nil and not to_s : String, then write the content to io. The latter works when you explicitly call it, but when you remove it and let interpolation handle it; it's calling a different overload. So tl;dr this isn't a bug. However, might be worth adding a sentence/another error if you define the wrong to_s overload?
Maybe I'm making a mistake here, but I have a class with a
to_s
method defined, and when I writeI get
and with
I get
But ameba gives me
which makes sense but why is the behavior different with the
to_s
inside the interpolation ? Using Crystal 0.35.1The text was updated successfully, but these errors were encountered: