fix #3486

since size(a,d) supports d > ndims(a), this should be allowed in general