Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rand(rng, UnitRange{Char}) defined but not callable #13600

Closed
vtjnash opened this issue Oct 14, 2015 · 0 comments
Closed

rand(rng, UnitRange{Char}) defined but not callable #13600

vtjnash opened this issue Oct 14, 2015 · 0 comments
Labels
domain:randomness Random number generation and the Random stdlib

Comments

@vtjnash
Copy link
Sponsor Member

vtjnash commented Oct 14, 2015

rand{T<:Union{Signed,Unsigned,BigInt,Bool,Char}}(rng::AbstractRNG, r::UnitRange{T}) = rand(rng, RangeGenerator(r)) defined at

rand{T<:Union{Signed,Unsigned,BigInt,Bool,Char}}(rng::AbstractRNG, r::UnitRange{T}) = rand(rng, RangeGenerator(r))
cannot be called for T<:Char since the definition of UnitRange asserts T<:Real. This appears to be harmless (e.g dead code) since the fallback rand(rng::AbstractRNG, r::AbstractArray) for Char(1):Char(3), aka StepRange{Char,Int64} works.

@rfourquet rfourquet added the domain:randomness Random number generation and the Random stdlib label Aug 27, 2017
rfourquet added a commit that referenced this issue Sep 1, 2017
Cf. #13600 and https://github.com/JuliaLang/julia/pull/22752/files#r128026174.
Also, changing `Union{Signed,Unsigned,BigInt,Bool}` to `Integer`, as this
is equivalent in practice.
rfourquet added a commit that referenced this issue Sep 5, 2017
Cf. #13600 and https://github.com/JuliaLang/julia/pull/22752/files#r128026174.
Also, changing `Union{Signed,Unsigned,BigInt,Bool}` to `Integer`, as this
is equivalent in practice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:randomness Random number generation and the Random stdlib
Projects
None yet
Development

No branches or pull requests

2 participants