Default constructor for parametric types in 0.7


#1

Hi,
this no longer works in v 0.7
what is the proper way to do this?

julia> struct XDD{T}
           x::T
           XDD()   = new{T}()
       end

julia> a= XDD{Int}()
ERROR: MethodError: no method matching XDD{Int64}()

#2

I think you want,

struct XDD{T}
   x::T
   XDD{T}() where {T} = new{T}()
end

#3
julia> struct XDD{T}
           x::T
           XDD()   = new{T}()
       end

I’m wondering why this isn’t an “outer-only constructor” on v0.6.