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

**URL:** <https://discourse.julialang.org/t/0-6-cxxwrap-expected-datatype-got-type/3833>\
**Category:** General Usage\
**Tags:** cxx\
**Created:** [May 21, 2017, 12:31pm UTC](https://discourse.julialang.org/t/0-6-cxxwrap-expected-datatype-got-type/3833 "2017-05-21T12:31:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SylvainCorlay](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaincorlay/32/923_2.png) [@SylvainCorlay](https://discourse.julialang.org/u/SylvainCorlay)\
**Post date:** [May 21, 2017, 12:31pm UTC](https://discourse.julialang.org/t/0-6-cxxwrap-expected-datatype-got-type/3833/1 "2017-05-21T12:31:33Z")

</div>

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

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

```

coming from

```julia
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

```julia
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.

---

<div class="post-metadata">

**Author:** ![SylvainCorlay](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaincorlay/32/923_2.png) [@SylvainCorlay](https://discourse.julialang.org/u/SylvainCorlay)\
**Post date:** [May 22, 2017, 6:36am UTC](https://discourse.julialang.org/t/0-6-cxxwrap-expected-datatype-got-type/3833/2 "2017-05-22T06:36:48Z")

</div>

So the issue is that

In Julia \< 0.6

```julia
> typeof(Array{Float64})
DataType

```

In Julia 0.6

```julia
> typeof(Array{Float64})
UnionAll

```

and

```julia
> isa(DataType, UnionAll)
false

```
