This works:
obj(x) = x'*[2 1;1 4]*x + x'*[1;4] + 7;
p = DSProblem(2; objective=obj, initial_point=[1.0,2.0]);
SetVariableBound(p, 1, -1.0, 1.0) ####This line is important
SetGranularity(p, Dict( 1 => 0.1, 2 => 0.2 ))
Optimize!(p)
But this doesn't
obj(x) = x'*[2 1;1 4]*x + x'*[1;4] + 7;
p = DSProblem(2; objective=obj, initial_point=[1.0,2.0]);
SetVariableBound(p, 1, -1, 1) ####This line is important - same bounds but ints
SetGranularity(p, Dict( 1 => 0.1, 2 => 0.2 ))
Optimize!(p)
And gives an error:

Not sure if this is a bug or just a documentation issue, see https://imperialcollegelondon.github.io/DirectSearch.jl/dev/man/usage/#Variable-Bounds-1
Edit:
Strangely enough, for multiple bounds at least one value in each vector needs to be a float. This works:
obj(x) = x'*[2 1;1 4]*x + x'*[1;4] + 7;
p = DSProblem(2; objective=obj, initial_point=[1.0,2.0]);
SetVariableBounds(p, [-1, -1.0], [2.0 ,2])
SetGranularity(p, Dict( 1 => 0.1, 2 => 0.2 ))
Optimize!(p)
This doesn't:
obj(x) = x'*[2 1;1 4]*x + x'*[1;4] + 7;
p = DSProblem(2; objective=obj, initial_point=[1.0,2.0]);
SetVariableBounds(p, [-1, -1], [2.0 ,2])
SetGranularity(p, Dict( 1 => 0.1, 2 => 0.2 ))
Optimize!(p)
and gives:

This works:
But this doesn't
And gives an error:

Not sure if this is a bug or just a documentation issue, see https://imperialcollegelondon.github.io/DirectSearch.jl/dev/man/usage/#Variable-Bounds-1
Edit:
Strangely enough, for multiple bounds at least one value in each vector needs to be a float. This works:
This doesn't:
and gives:
