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

A lot of ambiguities due to too general randsignatures #13

Open
thofma opened this issue Oct 3, 2022 · 1 comment
Open

A lot of ambiguities due to too general randsignatures #13

thofma opened this issue Oct 3, 2022 · 1 comment

Comments

@thofma
Copy link

thofma commented Oct 3, 2022

We are still using this quite heavily in Oscar land, but after playing around with https://github.com/JuliaTesting/Aqua.jl (which helps detecting method ambiguities), I noticed that RandomExtensions.jl leads to a lot of method ambiguities. For example, the methods

rand(X, ::Type{Tuple}, n::Integer)
     @ RandomExtensions ~/.julia/packages/RandomExtensions/qAD6J/src/containers.jl:53
rand(X, t::Type{<:Array}, dims::Integer...)
     @ RandomExtensions ~/.julia/packages/RandomExtensions/qAD6J/src/containers.jl:106

will make the pass-through methods

rand(T::MyAbstractType, v...) = rand(GLOBAL_RNG, T, v...)

ambiguous for certain input types (note that I cannot pin down the type of v directly, since T is abstract and there are many possible combinations).

They are usually fine in practice, but it just looks bad. There are so many, that ignoring them might hide real ambiguities.

@rfourquet
Copy link
Member

One problem with these methods in "containers.jl" is that they are doing type piracy, so the plan is to split the bulk of this package into a non-pirating part, which Oscar could be updated to depend on (last time I checked, Oscar was not depending on methods defined in this file).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants