Basically the transform is: move first argument to where `call` was (note that the function parameters stay):
call{T,Y}(::Type{A{I,T}}, t::T, y::Y) = ... (::Type{A{I,T}}){T,Y}(t::T, y::Y) = ... On Wed, 2016-06-29 at 23:59, Yichao Yu <yyc1...@gmail.com> wrote: > On Wed, Jun 29, 2016 at 5:46 PM, Bart Janssens <b...@bartjanssens.org> wrote: >> >> Hi all, >> >> I'm having some trouble adapting CxxWrap to the new constructor syntax (as >> opposed to adding call(::Type{...) methods in 0.4). The error is equivalent >> to the following pure Julia example: >> >> type MT{T} >> msg::String >> end >> >> julia> MT{Float64}() = MT{Float64}("float") >> WARNING: static parameter Float64 does not occur in signature for Type at >> REPL[67]:1. >> The method will not be callable. > > Follow the depwarn > > julia> type MT{T} > msg::String > end > > julia> call(::Type{MT{Float64}}) = MT{Float64}("float") > > WARNING: deprecated syntax "call(::Type{MT{Float64}}, ...)". > Use "(::Type{MT{Float64}})(...)" instead. > > >> >> And indeed: >> >> julia> MT{Float64}() >> ERROR: MethodError: no method matching MT{Float64}() >> >> The old syntax still works: >> julia> call(::Type{MT{Float64}}) = MT{Float64}("float") >> julia> MT{Float64}() >> MT{Float64}("float") >> >> Is there any way around this? Wrapping C++ template types requires >> specifying the template types in the constructor for all compiled-in types. >> >> Cheers, >> >> Bart