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
classFoo@bar=0definitialize(string)
if string.size >0@bar= string.size
endendendFoo.new("hello") # => instance variable '@bar' of Foo must be Int32, not Nil
I think it should use the default value that it was already given. It's what it does if initialize doesn't mention @bar at all.
The text was updated successfully, but these errors were encountered:
I think it should use the default value that it was already given. It's what it does if
initialize
doesn't mention@bar
at all.The text was updated successfully, but these errors were encountered: