module MyModule
struct AAA end
Base.one(A::AAA) = 1
@deprecate zero(A::AAA) one(A::AAA)
end
MyModule.zero(MyModule.AAA())
┌ Warning: `zero(A::AAA)` is deprecated, use `one(A::AAA)` instead.
│ caller = top-level scope at REPL[7]:1
└ @ Core REPL[7]:1
1
module MyModule
struct AAA end
Base.one(A::AAA) = 1
@deprecate (A::AAA)() one(A::AAA)
end
ERROR: LoadError: invalid usage of @deprecate
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] @deprecate(::LineNumberNode, ::Module, ::Any, ::Any, ::Bool) at ./deprecated.jl:57
[3] @deprecate(::LineNumberNode, ::Module, ::Any, ::Any) at ./deprecated.jl:34
in expression starting at REPL[4]:4
Is this a bug or there is a call
like function to deprecate instead of (A::AAA)()
?