Actors.jl: no method matching id(::Module, ::MyType)

在使用JuliaActors/GenServers.jl时,突然遇到一个错,

nested task error: 
        MethodError: no method matching id(::Module, ::NaTask)
        Closest candidates are:
          id(::Module) at C:\Users\Axier\.julia\packages\GenServers\RDs6e\src\genserver.jl:6
        Stacktrace:
         [1] (::Actors.var"#4#6"{Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, typeof(GenServers.id), Tuple{Module}})(c::NaTask)
           @ Actors C:\Users\Axier\.julia\packages\Actors\skg0T\src\types.jl:42
         [2] (::Actors.Bhv{Actors.var"#4#6"{Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, typeof(GenServers.id), Tuple{Module}}})(c::NaTask)
           @ Actors C:\Users\Axier\.julia\packages\Actors\skg0T\src\types.jl:46
         [3] onmessage(bhv::Actors.Bhv{Actors.var"#4#6"{Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, typeof(GenServers.id), Tuple{Module}}}, msg::Tuple{NaTask})
           @ Actors C:\Users\Axier\.julia\packages\Actors\skg0T\src\actor.jl:25
         [4] onmessage(A::Actors._ACT, msg::Tuple{NaTask})
           @ Actors C:\Users\Axier\.julia\packages\Actors\skg0T\src\actor.jl:39
         [5] onmessage(A::Actors._ACT, mode::Val{:genserver}, msg::Tuple{NaTask})
           @ Actors C:\Users\Axier\.julia\packages\Actors\skg0T\src\actor.jl:53
         [6] _act(ch::Channel{Any})
           @ Actors C:\Users\Axier\.julia\packages\Actors\skg0T\src\actor.jl:67
         [7] (::Base.var"#517#518"{typeof(Actors._act), Channel{Any}})()
           @ Base .\channels.jl:132

NaTask是我自定义的类型,报错信息指出的代码位置是:

struct Bhv{F}
    f
    a::Tuple
    kw::Base.Iterators.Pairs
    ϕ::F

    function Bhv(f, a...; kw...)
        ϕ = (c...) -> f(a..., c...; kw...)  # line: 42
        new{typeof(ϕ)}(f, a, kw, ϕ)
    end
end
(p::Bhv)(c...) = p.ϕ(c...)   #  line: 46

我暂时补了一个 GenServers.id(m::Moudle, t) = m 先用一下,但是为何出现这个错误还不得知。

备案号:京ICP备17009874号-2