Hello everyone!

I’m having a vexing problem with TypeError that is getting in the way of me producing a large amount of needed data.

Imagine a function foo whose return type is Array{T,2}, and a more complicated function bar whose return type is Array{Tuple{Array{Array{T,2},1},Array{Float64,1}},1}. I’m using parallel processing to produce a 2-dimensional array with dimensions NumberOfRows and NumberOfColumns.

The following code works without problems

MyFooArray = @parallel hcat for i=1:NumberOfColumns

[foo() for j=1:NumberOfRows]

end

The following also works OK

Column_1 = [bar() for j=1:NumberOfRows]

Column_2 = [bar() for j=1:NumberOfRows]

FirstTwoColumns = hcat(Column_1,Column_2)

Now here comes the problem. What I really want is not a 2d Array of Foos, but a 2d Array of Bars. In the last example, I produced one without a hitch, so hopefully I can produce a bigger one using a loop, right? Let’s try that

MyBarArray = @parallel hcat for i=1:NumberOfColumns

[bar() for j=1:NumberOfRows]

end

When I run this, julia throws the following TypeError

`ERROR: TypeError: collect_to!: in typeassert, expected Array{Tuple{Array{Array{T,2},1},Array{Float64,1}},1}, got Array{Tuple{Array{Array{T,2},1},Array{Float64,1}},1}`

What could be causing this? It got exactly the type it expected.

Thanks so much for your help.

Philip