Hello.
Since Normal{Float64} <: UnivariateDistribution
I would like to enforce that a Distribution field has a type parameter identical to the type of another field. Let me show you an example that does not work:
using Distributions
struct Foo{T<:Real, D{T} <: UnivariateDistribution}
x::T
d::D
end
So that if x is a Float32
, d cannot be a Normal{Float64}
but can be a Uniform{Float32}
.
How do I do that with a valid definition ?