From c625e459ef4d2b69ed0a55102c126714c7370ccf Mon Sep 17 00:00:00 2001 From: Miha Zgubic Date: Wed, 9 Sep 2020 14:36:13 +0100 Subject: [PATCH] update the deprecation warning --- src/compiler/interface.jl | 2 +- src/lib/lib.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/interface.jl b/src/compiler/interface.jl index 70b86775b..fb4e0a3e8 100644 --- a/src/compiler/interface.jl +++ b/src/compiler/interface.jl @@ -41,7 +41,7 @@ tailmemaybe(::Nothing) = nothing tailmemaybe(x::Tuple) = Base.tail(x) replacezero(x) = x -replacezero(::Nothing) = @warn "Use of 'nothing' to represent zero gradients is deprecated, use Zero() or DoesNotExist() from ChainRules"; return nothing +replacezero(::Nothing) = Base.depwarn("Use of 'nothing' to represent zero gradients is deprecated, use Zero() or DoesNotExist() from ChainRules", :replacezero); return nothing replacezero(::AbstractZero) = nothing replacezero(t::Tuple) = ntuple(i -> replacezero(t[i]), length(t)) diff --git a/src/lib/lib.jl b/src/lib/lib.jl index 6f06a458e..73b84e43e 100644 --- a/src/lib/lib.jl +++ b/src/lib/lib.jl @@ -166,7 +166,7 @@ unapply(t, xs) = _unapply(t, xs)[1] if Δ isa AbstractZero return Δ elseif Δ === nothing - println("hit 'nothing' in Core._apply") + println("hit 'nothing' in Core._apply") return Zero() else (first(Δ), unapply(st, Base.tail(Δ))...)