t = Struct.new("Foo", :hour, :min).new
t.hour = t.min = 1
t_offset = (t.hour * 60 * 60) + t.min *60
=> parse error, unexpected tSTAR, expecting $
Changing the end of the line to
"t.min * 60", ie adding a space after the star makes it compile successfully.
This doesn't only affect the '*' operator, but at least '+' suffers from the same bug.
I believe this was introduced with Ruby 1.8.4, but I'm not sure whether it also existed in previous releases. |