I am finishing a PR for fixing MLKernels.jl in Julia v0.6. I got stuck with the following issue. Suppose I have code of the form:
abstract type B{T} end
abstract type C{T} <: B{T} end
struct D1{T} <: B{T} end
struct D2{T} <: B{T} end
struct D3{T} <: C{T} end
tuple = (D1, D2, D3)
println(typeof(tuple))
Tuple{UnionAll,UnionAll,UnionAll}
In Julia v0.6, the tuple is inferred to contain UnionAll
(parametric types). MLKernels.jl is looping over a similar tuple to define the behavior of different kernels: https://github.com/trthatcher/MLKernels.jl/blob/master/src/kernel.jl#L354-L411
How to fix that loop so that the list of kernel types is inferred as a list of βKernel{T}
β? Or alternatively, how to fix the macro itself for Julia v0.6 and beyond?