Skip to content

more test_approx ambiguities #291

@lukas-weber

Description

@lukas-weber
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions