From 31a84ba62b1ab7effa0cd5f33ce3e7f3ea26dd33 Mon Sep 17 00:00:00 2001 From: David Widmann Date: Sun, 4 Jul 2021 16:56:19 +0200 Subject: [PATCH 1/2] Fix #1358 --- src/univariates.jl | 2 +- test/univariates.jl | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/univariates.jl b/src/univariates.jl index c75c579d5..f0b992087 100644 --- a/src/univariates.jl +++ b/src/univariates.jl @@ -646,7 +646,7 @@ macro _delegate_statsfuns(D, fpre, psyms...) pargs = [Expr(:(.), :d, Expr(:quote, s)) for s in psyms] # output type of `quantile` etc. - T = :($D isa DiscreteUnivariateDistribution ? Int : Real) + T = :($D <: DiscreteUnivariateDistribution ? Int : Real) return quote $Distributions.pdf(d::$D, x::Real) = $(fpdf)($(pargs...), x) diff --git a/test/univariates.jl b/test/univariates.jl index 8913b3866..4fa2fadc9 100644 --- a/test/univariates.jl +++ b/test/univariates.jl @@ -166,3 +166,12 @@ for c in ["discrete", verify_and_test_drive(jsonfile, ARGS, 10^6) println() end + +# #1358 +@testset "Poisson quantile" begin + d = Poisson(1) + @test quantile(d, 0.2) isa Int + @test cquantile(d, 0.4) isa Int + @test invlogcdf(d, log(0.2)) isa Int + @test invlogccdf(d, log(0.6)) isa Int +end From be7e6325506edc657a9f0464b914d4e2d855e8c4 Mon Sep 17 00:00:00 2001 From: David Widmann Date: Sun, 4 Jul 2021 16:56:26 +0200 Subject: [PATCH 2/2] Bump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 5e697abaa..0ee0e7b07 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Distributions" uuid = "31c24e10-a181-5473-b8eb-7969acd0382f" authors = ["JuliaStats"] -version = "0.25.8" +version = "0.25.9" [deps] FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"