JuliaRandom / JuliaRandom/RandomExtensions.jl
A lot of ambiguities due to too general `rand`signatures
- Ngôn ngữ chính
- Julia
- Star
- 19
- Fork
- 2
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Start by reproducing the ambiguity reports with Aqua.jl and inspect the methods shown in src/containers.jl, especially the definitions around lines 53 and 106. Trace how they interact with the pass-through rand(T::MyAbstractType, v...) method; done means the relevant ambiguities are understood and the project has a defined way to address or validate them.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- julia
- Lĩnh vực
- backend-api-design
- Loại issue
- Lỗi
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100