diff --git a/ext/ReactiveMPProjectionExt/ReactiveMPProjectionExt.jl b/ext/ReactiveMPProjectionExt/ReactiveMPProjectionExt.jl index 42d2895c5..260929a00 100644 --- a/ext/ReactiveMPProjectionExt/ReactiveMPProjectionExt.jl +++ b/ext/ReactiveMPProjectionExt/ReactiveMPProjectionExt.jl @@ -33,6 +33,9 @@ function BayesBase.prod(::GenericProd, division::DivisionOf, something) end end +BayesBase.prod(::GenericProd, division::DivisionOf, ::Missing) = division +BayesBase.prod(::GenericProd, ::Missing, division::DivisionOf) = division + function BayesBase.prod(::GenericProd, productof::ProductOf, divisionof::DivisionOf) return ProductOf(productof, divisionof) end diff --git a/test/ext/ReactiveMPProjectionExt/ReactiveMPProjectionExt_tests.jl b/test/ext/ReactiveMPProjectionExt/ReactiveMPProjectionExt_tests.jl index 984525247..d04bc2fb6 100644 --- a/test/ext/ReactiveMPProjectionExt/ReactiveMPProjectionExt_tests.jl +++ b/test/ext/ReactiveMPProjectionExt/ReactiveMPProjectionExt_tests.jl @@ -11,4 +11,6 @@ @test d1 ≈ prod(GenericProd(), ext.DivisionOf(d1, d2), d2) @test d1 ≈ prod(GenericProd(), d2, ext.DivisionOf(d1, d2)) + @test ext.DivisionOf(d1, d2) == prod(GenericProd(), ext.DivisionOf(d1, d2), missing) + @test ext.DivisionOf(d1, d2) == prod(GenericProd(), missing, ext.DivisionOf(d1, d2)) end