The syntax that would do what you expect is
D = @. a + b
which creates an array D instead of trying to do in-place assignment to an existing array.
The syntax that would do what you expect is
D = @. a + b
which creates an array D instead of trying to do in-place assignment to an existing array.