Hello all,

I actually fixed the problem by adding type specifications to all function 
calls and immutable types involved. Maybe this was also fixed in Julia 0.4 in 
the time being, but I was not able to follow as I follow the recommendation of 
developing all my package code in 0.3 and just testing it in 0.4. 

I’m sorry for not having notified the list as I got it sorted out, but since I 
got no replies in 5 days I thought I was just being silly and the solution was 
somehow obvious (instead of it being a bug in call overloading).

Best,
João

> On Nov 14, 2014, at 7:03 AM, Stefan Karpinski <[email protected]> wrote:
> 
> I'm not sure but it's quite possible that this was fixed independently of 
> this email. Jeff has been doing most of the work on call overloading and he 
> doesn't (afaik) read julia-users very often. Sorry that you wasted time on 
> that and thanks for looking into this.
> 
> On Fri, Nov 14, 2014 at 8:57 AM, Micky Latowicki <[email protected] 
> <mailto:[email protected]>> wrote:
> I started looking through your commit histories to find what was the line 
> that caused the problem. I saw that you fixed the problem since then. It 
> would have been courteous to note that your problem has been solved.
> 
> 
> On Sunday, November 9, 2014 12:18:20 AM UTC+2, João Felipe Santos wrote:
> Hi,
> 
> I have a module (called Auditory) which exports an immutable type (called 
> ModulationFilter) which is only a container for a vector of BiquadFilters (a 
> type exported by another module, DSP). It also exports a helper function for 
> constructing ModulationFilter, defined here: 
> https://github.com/jfsantos/Auditory.jl/blob/master/src/ModulationFilterbank.jl#L23
>  
> <https://github.com/jfsantos/Auditory.jl/blob/master/src/ModulationFilterbank.jl#L23>)
>  The code for the whole module is available here: 
> https://github.com/jfsantos/Auditory.jl 
> <https://github.com/jfsantos/Auditory.jl>. 
> 
> On Julia 0.3, all tests pass. However, when using 0.4, I get the following 
> error when calling make_modulation_filter (which simply creates a vector of 
> BiquadFilters and calls the default constructor for ModulationFilterbank):
> 
> ERROR: `convert` has no method matching 
> convert(::Type{ModulationFilterbank{T}}, ::Array{BiquadFilter{T},1})
>  in modulation_filterbank at 
> /Users/jfsantos/.julia/v0.4/Auditory/src/ModulationFilterbank.jl:24
> 
> Calling methods(ModulationFilterbank) in Julia 0.3 returns:
> 
> # 1 method for generic function "ModulationFilterbank":
> ModulationFilterbank{T}(filters::Array{BiquadFilter{T},1})
> 
> but in 0.4, I get instead:
> 
> 2-element Array{Any,1}:
>  call{T}(::Type{ModulationFilterbank{T}},filters::Array{BiquadFilter{T},1})
>  call{T}(::Type{T},args...) at base.jl:34
> 
> I thought there was a difference in how 0.3 and 0.4 deal with the “default 
> constructor”, so I tried replicating the example with a sillier module:
> 
> module Foo
> export Bar
> 
> immutable Bar{T}
>     x::Vector{T}
> end
> end
> 
> However, I am able to create elements of this immutable type with a default 
> constructor either in 0.3 or 0.4. Of course, in this case I don’t have the 
> additional complication of using a type defined in a second module. 
> 
> Can anyone point out where I am making a mistake here?
> 
> Thanks! 
> 
> Best regards
> João
> 

Reply via email to