It would be neat if there was a generic fallback for non-supported distributions. I can come up with a simple solution for continuous distributions:
# fallback for UnivariateContinuousDistribution
import Cubature
pcubature(x * Distributions.pdf(X,x), minimum(X), maximum(X))
but i need to think a bit more for discrete infinite supports.
Edit: There is ageneric fallback in Distributions.jl implemented there: https://github.com/JuliaStats/Distributions.jl/blob/master/src/functionals.jl
So maybe this is just an interface issue, Expectations.jl should not throw when it does not know the distribution but simply use the Distributions.jl one. Thanks @devmotion for the link.