Open SimonDanisch opened 6 years ago
replacing I with
CartesianIndex(1)
solved the issue
Which I
?
structure.f(tmap(x-> rec_func(x, I), structure.args)...)
-> rec_func(x, I)
seems fixed nowadays. infers to
julia> @code_warntype test(x, CartesianIndex(1))
MethodInstance for test(::Structure{typeof(+), Tuple{Structure{typeof(-), Tuple{Vector{Float64}, Vector{Float64}}}, Vector{Float64}}}, ::CartesianIndex{1})
from test(structure, I) @ Main REPL[7]:1
Arguments
#self#::Core.Const(Main.test)
structure::Structure{typeof(+), Tuple{Structure{typeof(-), Tuple{Vector{Float64}, Vector{Float64}}}, Vector{Float64}}}
I::CartesianIndex{1}
Body::Float64
1 ─ %1 = Main.rec_func(structure, I)::Float64
└── return %1
There is likely a more minimal example, but I couldn't come up with anything significantly more basic.
I tried a couple of things:
I
,f
,args
without successCartesianIndex(1)
solved the issuerec_func(x, I) = x
solved the issueBase.map
instead oftmap
or any other implementation of map i could come up with didn't help[1]