JuliaDiff / JuliaDiff/ChainRulesTestUtils.jl
more `test_approx` ambiguities
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 50
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
test_approx(Tangent{Float64}(), ZeroTangent())
test_approx(ZeroTangent(), Tangent{Float64}())
Fails due to method ambiguities.
ERROR: MethodError: test_approx(::Tangent{Float64, @NamedTuple{}}, ::ZeroTangent) is ambiguous.
Candidates:
test_approx(actual::Tangent{P, T}, expected; ...) where {T, P}
@ ChainRulesTestUtils /home/lweber/.julia/packages/ChainRulesTestUtils/Ko1Wr/src/check_result.jl:124
test_approx(x, ::AbstractZero; ...)
@ ChainRulesTestUtils /home/lweber/.julia/packages/ChainRulesTestUtils/Ko1Wr/src/check_result.jl:43
Possible fix, define
test_approx(::Tangent{P, T}, ::AbstractZero) where {T, P}
Stacktrace:
[1] top-level scope
@ REPL[7]:1
The equivalent with NoTangent() works.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in check_result.jl around the test_approx methods at lines 43 and 124, then compare the Tangent and AbstractZero dispatch with the working NoTangent case. Confirm that both shown Tangent/ZeroTangent calls resolve without ambiguity and that the existing test suite still passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100