Uses type information so it can detect non-literal ranges as well (Range or RangeFrom -- the other range types don't have step_by).