How to make new inner constructor syntax compatible with 0.5?

How do I make the new inner constructor syntax

immutable Foo{T}
       Foo{T}() where T = new()
end

compatible with 0.5? I tried @compat with no luck.

https://github.com/JuliaCollections/DataStructures.jl/pull/268/files#diff-78071e0e2a3c314cff6bd5583a983f9cR50

No @compat needed on 0.5.

Ah, so this:

immutable Foo{T}
       (::Type{Foo{T}}){T}() = new{T}()
end

Beautiful :nauseated_face:

1 Like