A user class that defines strftime makes Time#strftime raise NoMethodError when the receiver is poly (Time | UserClass): the dispatch only has the user arm. A monomorphic Time receiver is fine.
Same family as #3459 / #4413 (builtin arm lost under poly dispatch), not covered for Time#strftime.
class Date
def initialize(y); @y = y; end
def strftime(p); "D#{@y}"; end
end
def fmt(t)
t.strftime("%Y")
end
puts fmt(Time.at(0).utc)
puts fmt(Date.new(3))
CRuby:
Spinel (ab60de7):
undefined method 'strftime' for an instance of Time (NoMethodError)
Context: roundhouse PR rubys/roundhouse#423 adds a program-defined Date to the Spinel runtime; every Campfire page then 500s on Time#strftime.
A user class that defines
strftimemakesTime#strftimeraise NoMethodError when the receiver is poly (Time | UserClass): the dispatch only has the user arm. A monomorphicTimereceiver is fine.Same family as #3459 / #4413 (builtin arm lost under poly dispatch), not covered for
Time#strftime.CRuby:
Spinel (ab60de7):
Context: roundhouse PR rubys/roundhouse#423 adds a program-defined
Dateto the Spinel runtime; every Campfire page then 500s onTime#strftime.