Consider the parametric type below:
immutable Foo{N}
A::AbstractMatrix{Float64}
b::AbstractVector{Float64}
Foo(A,b) = size(A) == (N,length(b)) ? new(A,b) : error("incorrect size")
end
Because I defined the inner constructor, I can do:
Foo{3}(eye(3),ones(3)) # works
Foo{2}(eye(3),ones(3)) # fails as expected
but I cannot do:
Foo(eye(3),ones(3)) # fails but I would like it to work
How to solve this problem?