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" 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