-
-
Couldn't load subscription status.
- Fork 16
Open
Description
Suppose I have a type
using Functors
struct Foo{T1,T2}
x::T2
Foo{T1}(x::T2) where {T1,T2} = new{T1,T2}(x)
end
Then using
@functor Foo
will not manage to capture the T1 type:
x = Foo{Real}(2.0)
y, re = Functors.functor(x)
re(y)
ERROR: MethodError: no method matching Foo(::Float64)
Stacktrace:
[1] (::var"#5#6")(y::NamedTuple{(:x,), Tuple{Float64}})
@ Main ~/.julia/packages/Functors/qBIlC/src/functor.jl:23
[2] top-level scope
@ REPL[14]:1
using
@functor Foo{T} where {T}
is not helping more
Metadata
Metadata
Assignees
Labels
No labels