Hmmmm, somehow changing it so that one templated parameter was
consistently Domain{T<:Number} instead of a mix of Domain{T<:Number} and
Interval{T<:Number} fixed the bug.
Is it true that I should only be using concrete types as template
parameters? So Interval{Float64} instead of just Interval (which resolves to
Interval{T<:Number}).
> On 30 Mar 2015, at 11:42 am, Sheehan Olver <[email protected]> wrote:
>
>
>
> I have a weird bug in the promotion system where promote_type(a,b) is not
> equal to promote_type(b,a). It looks like the function call on line 101 of
> promotion.jl for one ordering is being called even though a≠b. a and b are
> different template variable choices of the same type. @code_typed returns
> two answers (which I've never seen before), corresponding to line 101 and
> line 110 of promotion.jl.
>
> I wish I could provide simplified code but it may be too complicated to
> narrow down. I'm wondering if anyone has encountered this before?
>
> Tested on Julia v0.3.7 and Julia v0.3.4.
>
>