[0.6][CxxWrap] `expected DataType, got Type`


#1

Testing xtensor-julia with julia 0.6.0-rc2, I am having the following issue:

TypeError: arrayset: expected DataType, got Type{Array{Float64,N} where N}

coming from

static jl_datatype_t* julia_type()
{
    // Array{T}
    return (jl_datatype_t*)apply_type(
        jl_get_global(jl_current_module, jl_symbol("Array")),
        jl_svec1(cxx_wrap::julia_type<T>())
    );
}

I tried the equivalent

std::string cmd = "Array{" + cxx_wrap::julia_type_name(cxx_wrap::julia_type<T>()) + "}";
return (jl_datatype_t*)jl_eval_string(cmd.c_str());

and am getting the same error.

So there seems to be an issue between DataType and Type in the 0.6 changes.


#2

So the issue is that

In Julia < 0.6

> typeof(Array{Float64})
DataType

In Julia 0.6

> typeof(Array{Float64})
UnionAll

and

> isa(DataType, UnionAll)
false