shiika icon indicating copy to clipboard operation
shiika copied to clipboard

`def to_s` (without return type) should be error

Open yhara opened this issue 2 years ago • 0 comments

Given

class A
  def to_s
    "#<A>"
  end
end

Expected

compile error (because this method overrides Object#to_s so the return type must be String)

Actual

compiled but does not work

yhara avatar Jun 26 '22 05:06 yhara