I don't really know if this is a bug or if there is some good technical
reason for this.
What seems to happen is that the definition
A(x, y) = new(x, y + 1)
removes the default constructor. You can see this by typing "A" on the REPL
(or methods(A))
Am Dienstag, 26. August 2014 09:14:10 UTC+2 schrieb Magnus Lie Hetland:
>
> OK, this works:
>
> immutable A{N}
>
> x::NTuple{N, Int}
>
> y::Int
>
> A(x, y) = new(x, y + 1)
>
> end
>
>
> A{N}(x::NTuple{N, Int}, y::Int) = A{N}(x, y)
>
> But why is this necessary? (Adding type decl. to the internal constructor
> doesn't seem to do anything useful.) And why is it not necessary if I don't
> have an internal constructor?
>
> (Oh, by the way: Please ignore the abstract C in the previous example ;-))
>