You cannot do this directly. You need to reformulate the problem.
model = Model()
S = [2, 5, 6, 8, 10]
@variable(model, x, Int)
@variable(model, z[1:length(S)], Bin)
@constraint(model, sum(z) == 1)
@constraint(model, x == sum(S[i] * z[i] for i = 1:length(S))