Dear Julia users:
I'm trying to define a parametric composite type with fields whose types
depend on both the type parameter as well as the parameter of the type
parameter. This is what I tried:
type Foo{T}
a::T
end
type Bar{F <: Foo}
a::F
b::F.parameters[1]
end
ERROR: type TypeVar has no field parameters
type Bar{F <: Foo{T})
a::F
b::T
end
ERROR: UndefVarError: T not defined
Is there any way to achieve what I am trying to do without explicitly
parametrizing Bar by T? Explicitly parametrizing would work, however, it
feels redundant since T is already contained in Foo.
Best,
Robert