You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using Distributions
using Random
import Random: rand
using StatsFuns.RFunctions: tdistrand
export StdT
"""
StdT <: Distribution{Univariate, Continuous}
Standardized t distribution.
"""
struct StdT <: Distribution{Univariate, Continuous}
v::Float64
end
rand(d::StdT) = tdistrand(d.v)*sqrt((d.v-2)/d.v)
Random.seed!(1)
@show rand(StdT(4), 1)
end
but errors on 0.17.0 with
ERROR: LoadError: MethodError: no method matching iterate(::Main.Repro.StdT)
Closest candidates are:
iterate(::Core.SimpleVector) at essentials.jl:568
iterate(::Core.SimpleVector, ::Any) at essentials.jl:568
iterate(::ExponentialBackOff) at error.jl:199
...
Stacktrace:
[1] copyto!(::Array{Float64,1}, ::Main.Repro.StdT) at .\abstractarray.jl:668
[2] _collect(::UnitRange{Int64}, ::Main.Repro.StdT, ::Base.HasEltype, ::Base.HasLength) at .\array.jl:550
[3] collect(::Main.Repro.StdT) at .\array.jl:544
[4] #quantile#51(::Bool, ::Function, ::Main.Repro.StdT, ::Float64) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Statistics\src\Statistics.jl:916
[5] quantile(::Main.Repro.StdT, ::Float64) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Statistics\src\Statistics.jl:916
[6] rand(::Random.MersenneTwister, ::Main.Repro.StdT) at C:\Users\broda\.julia\packages\Distributions\fMt8c\src\univariates.jl:177
[7] rand! at C:\Users\broda\.julia\packages\Distributions\fMt8c\src\univariates.jl:167 [inlined]
[8] rand at C:\Users\broda\.julia\packages\Distributions\fMt8c\src\univariates.jl:160 [inlined]
[9] rand(::Main.Repro.StdT, ::Int64) at C:\Users\broda\.julia\packages\Distributions\fMt8c\src\genericrand.jl:24
[10] top-level scope at show.jl:555
in expression starting at C:\Users\broda\Documents\julia\local_packages\Repro\src\Repro.jl:17
The following code works on 0.16.4
but errors on 0.17.0 with
Conversely, changing
to
works on v0.17.0, but fails on v0.16.4, with the same error. The code works on both versions if both definitions are present.
I can't seem to find anything in the docs about this change.
Thanks!
Simon
The text was updated successfully, but these errors were encountered: