From missing parentheses to memory corruption: how one typo crashed Ruby and uncovered two core bugs

Ruby bug #21220 TLDR: Click here if you just want the highlights Ruby's range syntax has lower precedence than method invocation, so 1..16.size returns the Range 1..8 (probably 1..4 on 32-bit systems), while (1..16).size returns the Integer 16 . Because of this, we need to wrap a range in parentheses or store it in a variable when we want to call a method on the range. I missed the parentheses…