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