Hi,
I have a situation where I want to have a few tuples as type parameters. In v0.5 I used to have
# works in v0.5
immutable foo{a, b, N, T}
foo{N, T}(a_::NTuple{N, T}, b_::NTuple{N, T}) = new()
end
foo(a, b) = foo{a, b, length(a), eltype(a)}(a, b)
@show foo((1, 2), (3, 4))
where the inner constructor enforces the constraint that the lengths of the tuple must be the same.
I am converting my packages to v0.6 but I am not able to achieve the same result. The main difference is that now all type parameters need to be specified in the inner constructor. Here is an example of something that does not work
# does not work in v0.6
struct foo{a, b, N, T}
(::foo){a, b, N, T}(a_::NTuple{N, T}, b_::NTuple{N, T}) = new{a, b, N, T}()
end
foo(a, b) = foo{a, b, length(a), eltype(a)}(a, b)
@show foo((1, 2), (3, 4))
as the parameters a, b
do not appear in the function signature.
Thanks,
Davide