# Porting MLKernels.jl to Julia v0.6

**URL:** <https://discourse.julialang.org/t/porting-mlkernels-jl-to-julia-v0-6/6191>\
**Category:** Machine Learning\
**Tags:** macros, parametric-types\
**Created:** [October 2, 2017, 4:39am UTC](https://discourse.julialang.org/t/porting-mlkernels-jl-to-julia-v0-6/6191 "2017-10-02T04:39:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [October 2, 2017, 4:39am UTC](https://discourse.julialang.org/t/porting-mlkernels-jl-to-julia-v0-6/6191/1 "2017-10-02T04:39:10Z")

</div>

I am finishing a [PR](https://github.com/trthatcher/MLKernels.jl/pull/56) for fixing MLKernels.jl in Julia v0.6. I got stuck with the following issue. Suppose I have code of the form:

```julia
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](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?

---

<div class="post-metadata">

**Author:** ![cstjean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cstjean/32/1444_2.png) [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Post date:** [October 2, 2017, 2:12pm UTC](https://discourse.julialang.org/t/porting-mlkernels-jl-to-julia-v0-6/6191/2 "2017-10-02T14:12:45Z")

</div>

The code you link to is a top-level loop. Does it matter if it’s inferred correctly or not?

> [@juliohm](#):
>
> Or alternatively, how to fix the macro itself for Julia v0.6 and beyond?

Which macro?

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [October 2, 2017, 3:12pm UTC](https://discourse.julialang.org/t/porting-mlkernels-jl-to-julia-v0-6/6191/3 "2017-10-02T15:12:28Z")

</div>

Thank you @cstjean, apparently there is another branch `dev` that already supports Julia v0.6. I closed the PR and will wait for a new release. Thanks for the help anyways.
