# Broadcast dot in a normal setfield! - intended behavior or bug?

**URL:** https://discourse.julialang.org/t/broadcast-dot-in-a-normal-setfield-intended-behavior-or-bug/17707
**Category:** General Usage
**Created:** [November 19, 2018, 9:47am UTC](https://discourse.julialang.org/t/broadcast-dot-in-a-normal-setfield-intended-behavior-or-bug/17707 "2018-11-19T09:47:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)
#### Post date: [November 19, 2018, 9:47am UTC](https://discourse.julialang.org/t/broadcast-dot-in-a-normal-setfield-intended-behavior-or-bug/17707/1 "2018-11-19T09:47:35Z")

</div>

This errors in the latest Julia master but worked in Julia 0.6.4.

```julia
a = [1, 2]
a[2] .= a[1]

```

Is this issue-worthy or the intended behavior?

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [November 19, 2018, 12:49pm UTC](https://discourse.julialang.org/t/broadcast-dot-in-a-normal-setfield-intended-behavior-or-bug/17707/2 "2018-11-19T12:49:39Z")

</div>

On version 0.7:

```julia
julia> a = [1,2]
2-element Array{Int64,1}:
 1
 2

julia> a[2] .= a[1]
┌ Warning: the behavior of `A[I...] .= X` with scalar indices will change in the
 future. Use `A[I...] = X` instead.
│ caller = ip:0x0
└ @ Core :-1
0-dimensional view(::Array{Int64,1}, 2) with eltype Int64:
1

julia> a
2-element Array{Int64,1}:
 1
 1

```

---

<div class="post-metadata">

### Author: ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)
#### Post date: [November 19, 2018, 12:51pm UTC](https://discourse.julialang.org/t/broadcast-dot-in-a-normal-setfield-intended-behavior-or-bug/17707/3 "2018-11-19T12:51:05Z")

</div>

Thanks!
