Issue 1:
This is a reduced version of the issue raised at https://discourse.julialang.org/t/type-unstable-keyword-constructor-on-parameterized-type/8852

I think its a bug, but I could be wrong.

Basically, the presence of (even unused) keyword args in an inner constructor spoils type-stability.

On 0.6.1

julia> struct Foo
Foo(; kwargs...) = new()
end

julia> @code_warntype Foo()
Variables:
#self#::Type{Foo}

Body:
begin
return ((Core.getfield)($(QuoteNode(Core.Box(#call#1))), :contents)::Any)($(Expr(:foreigncall, :(:jl_alloc_array_1d), Array{Any,1}, svec(Any, Int64), Array{Any,1}, 0, 0, 0)), #self#::Type{Foo})::Any
end::Any

and current master (251a501)

julia> struct Foo
Foo(; kwargs...) = new()
end

julia> @code_warntype Foo()
Variables:
#self#::Type{Foo}
#Foo#1@_3::Nothing

Body:
begin
Core.SSAValue(0) = $(QuoteNode(Core.Box(getfield(, Symbol("##Foo#1#2"))())))
Core.SSAValue(1) = (Core.isdefined)(Core.SSAValue(0), :contents)::Bool
unless Core.SSAValue(1) goto 5
goto 8
5:
Core.NewvarNode(:(#Foo#1@_3::Nothing))
#Foo#1@_3::Nothing
8:
Core.SSAValue(2) = (Core.getfield)(Core.SSAValue(0), :contents)::Any
Core.SSAValue(5) = (Core.SSAValue(2))($(QuoteNode(Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}())), #self#::Type{Foo})::Any
return Core.SSAValue(5)
end::Any

Issue 2:
I find constructors taking keyword arguments are a lot slower than constructors that don't. For example,

julia> immutable PositionalArg
x::Int
PositionalArg(x::Int=1) = new(x)
end

julia> immutable KeywordArg
x::Int
KeywordArg(;x::Int=1) = new(x)
end

julia> using BenchmarkTools

julia> @benchmark PositionalArg()
BenchmarkTools.Trial:
memory estimate: 0.00 bytes
allocs estimate: 0
--------------
minimum time: 2.087 ns (0.00% GC)
median time: 2.092 ns (0.00% GC)
mean time: 2.381 ns (0.00% GC)
maximum time: 386.548 ns (0.00% GC)
--------------
samples: 10000
evals/sample: 1000
time tolerance: 5.00%
memory tolerance: 1.00%

julia> @benchmark KeywordArg()
BenchmarkTools.Trial:
memory estimate: 16.00 bytes
allocs estimate: 1
--------------
minimum time: 75.253 ns (0.00% GC)
median time: 78.912 ns (0.00% GC)
mean time: 101.540 ns (1.62% GC)
maximum time: 26.617 μs (0.00% GC)
--------------
samples: 10000
evals/sample: 970
time tolerance: 5.00%
memory tolerance: 1.00%

Such a huge difference seems to be caused by the additional allocations that constructors with keyword arguments use. However, I'm not sure if that has to be the case, because ordinary functions don't seem to be using additional allocations when taking keyword arguments:

julia> posarg(x::Int=1) = x
posarg (generic function with 2 methods)

julia> kwdarg(;x::Int=1) = x
kwdarg (generic function with 1 method)

julia> @benchmark posarg()
BenchmarkTools.Trial:
memory estimate: 0.00 bytes
allocs estimate: 0
--------------
minimum time: 1.997 ns (0.00% GC)
median time: 1.998 ns (0.00% GC)
mean time: 2.282 ns (0.00% GC)
maximum time: 95.239 ns (0.00% GC)
--------------
samples: 10000
evals/sample: 1000
time tolerance: 5.00%
memory tolerance: 1.00%

julia> @benchmark kwdarg()
BenchmarkTools.Trial:
memory estimate: 0.00 bytes
allocs estimate: 0
--------------
minimum time: 1.997 ns (0.00% GC)
median time: 1.998 ns (0.00% GC)
mean time: 2.042 ns (0.00% GC)
maximum time: 273.882 ns (0.00% GC)
--------------
samples: 10000
evals/sample: 1000
time tolerance: 5.00%
memory tolerance: 1.00%

Is this a matter that can be fixed easily, or I need to refrain from using keyword arguments in constructors?

Here is the version info:

julia> versioninfo()
Julia Version 0.6.0-dev.1636
Commit 99b6a8c* (2016-12-20 13:46 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin16.0.0)
CPU: Intel(R) Core(TM)2 Duo CPU T9900 @ 3.06GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Penryn)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.7.1 (ORCJIT, penryn)