It does not work because Vararg is defined to work if and only if it is the last parameter.
To pass some varying number of values as your x, use a Tuple(1, 2)(1, 2, 3) etc
where f(x::Tuple, y::Float64).
It isn’t really a limitation since you can’t have more than one vararg in the method signature, no matter what. Having it in a location other than the end will only add unnecessary complexity.
the API would be more uniform in that case if the size argument came last, but it seems it is not possible since it would require a vararg as a first argument.
In any case, it should at least be easiest to allow to be either the first or last argument in a method.