How to exactly lock the type of the arguments of a function?

You do not set beta as a 2D array, you take the elements from the 2D array [1.0 2.0; 3.0 3.0] and put them into the 1D array beta. Afterwards, beta is still a 1D array. That is what the dot in .= does: it performs the assignment elementwise.

Edit: I did not see that you actually call gauss with a 2D array. In that case, it should definitely error. Are you sure you didn’t define another method that works with 2D arrays?