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


#1

Any ideas on where to look?

Julia 0.7 as of this evening.

┌ 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

#2

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

struct Noop end

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

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

#3

Apply this

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).

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: