Skip to content

Commit 27a8f8c

Browse files
committed
Add depwarn for AnonymousWalk
1 parent 3f11d5a commit 27a8f8c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/walks.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ Attempting to wrap an existing `AbstractWalk` is a no-op (i.e. it is not wrapped
2727
"""
2828
struct AnonymousWalk{F} <: AbstractWalk
2929
walk::F
30+
31+
function AnonymousWalk(walk::F) where F
32+
Base.depwarn("Wrapping a custom walk function as an `AnonymousWalk`. Future versions will only support custom walks that explicitly subtyle `AbstractWalk`.", :AnonymousWalk)
33+
return new{F}(walk)
34+
end
3035
end
3136
# do not wrap an AbstractWalk
3237
AnonymousWalk(walk::AbstractWalk) = walk

0 commit comments

Comments
 (0)