Given an array of arrays x = Array[isodd(i) ? [1i,2i] : [1.0i 2.0i] for i=1:10] x = Array[isodd(i) ? [1i,2i] : [1.0i 2.0i] for i=1:10] , Julia reports her type as Array{Array{T,N},1} . This is misleading, as there appears to be some T and some N for which the corresponding type will match. But this is not so: the odd elements will be of type Array{Int,1} , and evens will be of type Array{Float64,2} . Therefore, when you try to write a method for foo with parameters like:
foo{T,N}(::Array{Array{T,N},1}) = T,N
What is T and N for x ? It is clear that there is no such N - it is both 1 and 2! Elements of these subarrays are not of type Any - they are both Int and Float64 . The same thing applies to Array[[0,1],[0,1,2]] , although in your example you know that T and N consistent, a system like Julia is not ... and you can potentially click elements that are not int vectors.
There are many ways around this. The best approach is to try to make sure that your arrays always have specific (or at least homogeneous) element types, but this is not always possible. Given your example x above, you could write: x = Array{Int,1}[[0,1],[1,2,3],[0,1,2,4]] .
Another alternative is to change your function signature:
foo{N}(x::Array{Array,N}) = 1
The first applies only if you have exactly this type due to invariance , while the second will work for all arrays of arrays, like bad type and concrete.
(Edit: As a final note, N<:Number will not correspond to literal numbers. It will correspond to types of the subtype Number , such as Real or Int . There is currently no way to express this type parameter should be a value of type Int outside of the convention that N is integer).