# Warning: deprecated syntax .+?

**URL:** <https://discourse.julialang.org/t/warning-deprecated-syntax/4645>\
**Category:** General Usage\
**Tags:** question\
**Created:** [July 4, 2017, 5:16pm UTC](https://discourse.julialang.org/t/warning-deprecated-syntax/4645 "2017-07-04T17:16:59Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [July 4, 2017, 5:16pm UTC](https://discourse.julialang.org/t/warning-deprecated-syntax/4645/1 "2017-07-04T17:16:59Z")

</div>

Recently, I noticed this warning on my Travis builds Julia v0.6:

> WARNING: deprecated syntax “function .+(…)”.  
> Use “function Base.broadcast(::typeof(+), …)” instead.

Can you please confirm the dot notation is not deprecated?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [July 4, 2017, 5:22pm UTC](https://discourse.julialang.org/t/warning-deprecated-syntax/4645/2 "2017-07-04T17:22:41Z")

</div>

Yes. `.+` no longer exists, neither do any of the `.` operators. Instead, all `.` operators are now just calls to `broadcast(!)`

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [July 4, 2017, 5:23pm UTC](https://discourse.julialang.org/t/warning-deprecated-syntax/4645/3 "2017-07-04T17:23:22Z")

</div>

You mean we have to write `broadcast` everywhere?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [July 4, 2017, 5:24pm UTC](https://discourse.julialang.org/t/warning-deprecated-syntax/4645/4 "2017-07-04T17:24:02Z")

</div>

No? Just use `.+`. You can’t extend “the operator `.+`” because it doesn’t actually exist though: `.+` means `broadcast(+,...)`

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [July 4, 2017, 5:24pm UTC](https://discourse.julialang.org/t/warning-deprecated-syntax/4645/5 "2017-07-04T17:24:52Z")

</div>

My question is because of these warnings:

> **[Travis CI - Test and Deploy with Confidence](https://app.travis-ci.com/juliohm/ImageQuilting.jl/jobs/249756795)**
>
> Travis CI enables your team to test and ship your apps with confidence. Easily sync your projects with Travis CI and you'll be testing your code in minutes.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [July 4, 2017, 5:26pm UTC](https://discourse.julialang.org/t/warning-deprecated-syntax/4645/6 "2017-07-04T17:26:08Z")

</div>

I am just using .+ everywhere and the deprecation warnings are showing up. I am probably doing something wrong somewhere else.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [July 4, 2017, 5:26pm UTC](https://discourse.julialang.org/t/warning-deprecated-syntax/4645/7 "2017-07-04T17:26:41Z")

</div>

Either you or a package you are using has an overload of `.+`.

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [July 4, 2017, 5:26pm UTC](https://discourse.julialang.org/t/warning-deprecated-syntax/4645/8 "2017-07-04T17:26:48Z")

</div>

If you read the depwarn carefully, it’s telling you that the function definition have been deprecated, not the use of it.

---

<div class="post-metadata">

**Author:** ![Evizero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evizero/32/10118_2.png) [@Evizero](https://discourse.julialang.org/u/Evizero)\
**Post date:** [July 4, 2017, 5:27pm UTC](https://discourse.julialang.org/t/warning-deprecated-syntax/4645/9 "2017-07-04T17:27:47Z")

</div>

wild guess: [https://github.com/SimonDanisch/FixedSizeArrays.jl/blob/master/src/ops.jl#L42](https://github.com/SimonDanisch/FixedSizeArrays.jl/blob/master/src/ops.jl#L42)

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [July 4, 2017, 5:27pm UTC](https://discourse.julialang.org/t/warning-deprecated-syntax/4645/10 "2017-07-04T17:27:54Z")

</div>

Thank you all, makes sense, probably one of my dependencies is redefining `.+`

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [July 4, 2017, 5:28pm UTC](https://discourse.julialang.org/t/warning-deprecated-syntax/4645/11 "2017-07-04T17:28:19Z")

</div>

On the spot @Evizero 🙂

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [July 4, 2017, 5:58pm UTC](https://discourse.julialang.org/t/warning-deprecated-syntax/4645/12 "2017-07-04T17:58:08Z")

</div>

By the way, StaticArrays.jl now provides `StaticArrays.FixedSizeArrays` which is (mostly) compatible with the old FixedSizeArrays and designed for Julia v0.6. It’s also much nicer since it plays well with the regular StaticArrays types. You might be able to switch over to it without much hassle and get Julia v0.6 compatibility for free.

---

<div class="post-metadata">

**Author:** ![tamasgal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamasgal/32/27946_2.png) [@tamasgal](https://discourse.julialang.org/u/tamasgal)\
**Post date:** [July 4, 2017, 6:04pm UTC](https://discourse.julialang.org/t/warning-deprecated-syntax/4645/13 "2017-07-04T18:04:50Z")

</div>

Btw. I first saw this deprecation warning when I ran some older code where I defined the `+` function for other types:

```julia
v0.6.0> import Base

v0.6.0> Base.+(x::Foo, y::Foo) = ...
WARNING: deprecated syntax "function .+(...)".
Use "function Base.broadcast(::typeof(+), ...)" instead.

```

Which I fixed with direct import:

```julia
v0.6.0> import Base.+

v0.6.0> +(x::Foo, y::Foo) = ...

```

---

<div class="post-metadata">

**Author:** ![ararslan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ararslan/32/3825_2.png) [@ararslan](https://discourse.julialang.org/u/ararslan)\
**Post date:** [July 4, 2017, 6:16pm UTC](https://discourse.julialang.org/t/warning-deprecated-syntax/4645/14 "2017-07-04T18:16:46Z")

</div>

To extend `+` without an explicit import, you can do

```julia
Base.:+(x, y) = ...

```

You can also avoid the `.` in the `import` statement by using

```julia
import Base: +

```

if you so choose, though of course as you saw, what you have works.
