# Strange warning with \`Pkg.test("LightGraphs")\`

**URL:** <https://discourse.julialang.org/t/strange-warning-with-pkg-test-lightgraphs/11255>\
**Category:** General Usage\
**Created:** [May 30, 2018, 4:38am UTC](https://discourse.julialang.org/t/strange-warning-with-pkg-test-lightgraphs/11255 "2018-05-30T04:38:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon94023334](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Post date:** [May 30, 2018, 4:38am UTC](https://discourse.julialang.org/t/strange-warning-with-pkg-test-lightgraphs/11255/1 "2018-05-30T04:38:14Z")

</div>

Any ideas on where to look?

Julia 0.7 as of this evening.

```julia
┌ Warning: broadcast will default to iterating over its arguments in the future. Wrap arguments of
│ type `x::Noop` with `Ref(x)` to ensure they broadcast as "scalar" elements.
│ caller = ip:0x0
└ @ Core :-1

```

---

<div class="post-metadata">

**Author:** ![anon94023334](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Post date:** [May 30, 2018, 4:42am UTC](https://discourse.julialang.org/t/strange-warning-with-pkg-test-lightgraphs/11255/2 "2018-05-30T04:42:46Z")

</div>

I think it’s here, but I’m not quite sure how to fix it:

```julia
struct Noop end

Base.broadcast(::typeof(*), ::Noop, x) = x

LinearAlgebra.Diagonal(::Noop) = Noop()

```

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [May 30, 2018, 6:33am UTC](https://discourse.julialang.org/t/strange-warning-with-pkg-test-lightgraphs/11255/3 "2018-05-30T06:33:15Z")

</div>

Apply this

```diff
diff --git a/src/linalg/graphmatrices.jl b/src/linalg/graphmatrices.jl
index a84efd0..790be47 100644
--- a/src/linalg/graphmatrices.jl
+++ b/src/linalg/graphmatrices.jl
@@ -109,7 +109,7 @@ different scaled GraphMatrix types.
 """
 struct Noop end
 
-Base.broadcast(::typeof(*), ::Noop, x) = x
+Broadcast.broadcasted(::typeof(*), ::Noop, x) = x
 
 LinearAlgebra.Diagonal(::Noop) = Noop()

```

to your branch `sbromberger/fix-0.7-depwarns` ([PR](https://github.com/JuliaGraphs/LightGraphs.jl/pull/895)).

Basically, `broadcast(::typeof(*), ::Noop, x) = x` is never called unless you literally call `broadcast` (i.e. it will not be invoked by `.` syntax).

Relevant reading for new broadcast interface:

- Matt’s blog post: [Extensible broadcast fusion](https://julialang.org/blog/2018/05/extensible-broadcast-fusion)
- Interface manual: [https://docs.julialang.org/en/latest/manual/interfaces/#man-interfaces-broadcasting-1](https://docs.julialang.org/en/latest/manual/interfaces/#man-interfaces-broadcasting-1)
