I think this could be a good discussion for a new feature, in case it is possible. In case this is intentional and not possible, it might be a good place for an answer.
Previous considerations
There is a discussion for the case where two arguments to the struct are parametric in Types, whether bi-parametric or single-parametric. It says that this constructor is not provided by default because there could be ambiguity between the possible extrapolated types. However, this is not always the case.
Counter example (single parameter)
struct single_param{T}
r::Float64
s::T
end
In this case, the type could be easily extrapolated from the variables passed with a single parametric method.
# Current status
julia> prueba(3,9)
ERROR: MethodError: no method matching single_param(::Int64, ::Int64)
Closest candidates are:
single_param(::Float64, ::T) where T at REPL[1]:2
# Solution
julia> single_param(r, s::T) where {T} = single_param{T}(r, s)
single_param
julia> single_param(3,9)
single_param{Int64}(3.0, 9)
julia> single_param(3,"4")
single_param{String}(3.0, "4")
Counter example (multi parameter)
struct multi_param{T, U}
q::Float64
r::T
s::U
end
Even in this case, the types could be extrapolated from the variables passed.
# Current status
julia> multi_param(3,9,"7")
ERROR: MethodError: no method matching multi_param(::Int64, ::Int64, ::String)
Closest candidates are:
multi_param(::Float64, ::T, ::U) where {T, U} at REPL[8]:2
# Solution
julia> multi_param(q, r::T, s::U) where {T, U} = multi_param{T, U}(q, r, s)
multi_param
julia> multi_param(3,9,7im)
multi_param{Int64, Complex{Int64}}(3.0, 9, 0 + 7im)
julia> multi_param(3,9,"t")
multi_param{Int64, String}(3.0, 9, "t")
Conclusions
I take the liberty of summoning @StefanKarpinski in case there is a reason for this (sorry if it is already somewhere, I cannot find it in the docs).