Hello, I am new to Julia and need some help please.

I want to use Composite types and add them to an Array.

The following is a simple example:

```
type State
x::Int64
end
s=State(1)
data = Array{State}(1)
data[1]=s
println(data[1].x)
for i=2:5
s.x=i
push!(data,s)
println(data[i].x)
end
```

Run it in Julia:

```
julia> include("test2.jl")
1
2
3
4
5
```

So it seems to work.

But if i now enter `data[2].x`

(or `data[1].x`

, `data[3].x`

…) in the command line:

```
julia> data[2].x
5
```

or another example:

```
julia> data
5-element Array{State,1}:
State(5)
State(5)
State(5)
State(5)
State(5)
```

I don’t understand why data is filled correctly during the for-loop but afterwards the data Arrays only contains the last `State`

with `x=5`

I would appreciate any help. thanks in advance