When applying pmap
, it seems like type inference breaks down, as shown below:
julia> using Distributed
julia> f(x) = pmap(val -> val^2, [x])
f (generic function with 1 method)
julia> @code_warntype f(2)
Variables
#self#::Core.Const(f)
x::Int64
#5::var"#5#6"
Body::Any
1 ─ (#5 = %new(Main.:(var"#5#6")))
│ %2 = #5::Core.Const(var"#5#6"())
│ %3 = Base.vect(x)::Vector{Int64}
│ %4 = Main.pmap(%2, %3)::Any
└── return %4
I’m running into this issue because I’m trying to make a contribution to a package, and the contribution uses remote calls, so the tests are complaining that the inferred type (Any
) is different from the returned type. How can I deal with this problem? Thank you!