Skip to content

Ambiguity error when solving NonlinearProblem on master #497

@AayushSabharwal

Description

@AayushSabharwal

I get an ambiguity error when solving a NonlinearProblem on master. Still working on an MWE, but opening the issue in case it's immediately apparent what the ambiguity is:

ERROR: MethodError: __solve(::NonlinearProblem{…}, ::NonlinearSolvePolyAlgorithm{…}) is ambiguous.

Candidates:
  __solve(prob::SciMLBase.AbstractNonlinearProblem, alg::NonlinearSolvePolyAlgorithm{Val{N}}, args...; stats, alias_u0, verbose, kwargs...) where N
    @ NonlinearSolveBase ~/Julia/SciML/NonlinearSolve.jl/lib/NonlinearSolveBase/src/solve.jl:106
  __solve(prob::Union{NonlinearLeastSquaresProblem{<:Union{Number, var"#s15"} where var"#s15"<:AbstractArray, iip, <:Union{var"#s14", var"#s13"} where {var"#s14"<:ForwardDiff.Dual{T, V, P}, var"#s13"<:(AbstractArray{<:ForwardDiff.Dual{T, V, P}})}} where {iip, T, V, P}, NonlinearProblem{<:Union{Number, var"#s15"} where var"#s15"<:AbstractArray, iip, <:Union{var"#s14", var"#s13"} where {var"#s14"<:ForwardDiff.Dual{T, V, P}, var"#s13"<:(AbstractArray{<:ForwardDiff.Dual{T, V, P}})}} where {iip, T, V, P}}, alg::NonlinearSolveBase.AbstractNonlinearSolveAlgorithm, args...; kwargs...)
    @ NonlinearSolve ~/Julia/SciML/NonlinearSolve.jl/src/forward_diff.jl:14
  __solve(prob::Union{NonlinearLeastSquaresProblem{<:Union{Number, var"#s15"} where var"#s15"<:AbstractArray, iip, <:Union{var"#s14", var"#s13"} where {var"#s14"<:ForwardDiff.Dual{T, V, P}, var"#s13"<:(AbstractArray{<:ForwardDiff.Dual{T, V, P}})}} where {iip, T, V, P}, NonlinearProblem{<:Union{Number, var"#s15"} where var"#s15"<:AbstractArray, iip, <:Union{var"#s14", var"#s13"} where {var"#s14"<:ForwardDiff.Dual{T, V, P}, var"#s13"<:(AbstractArray{<:ForwardDiff.Dual{T, V, P}})}} where {iip, T, V, P}}, alg::NonlinearSolvePolyAlgorithm, args...; kwargs...)
    @ NonlinearSolve ~/Julia/SciML/NonlinearSolve.jl/src/forward_diff.jl:14

Possible fix, define
  __solve(::Union{…}, ::NonlinearSolvePolyAlgorithm{…}, ::Vararg{…}) where N

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions