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

Fix method ambiguity error of NaNMath.pow #690

Merged
merged 3 commits into from
Jan 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ function number_methods(T, rhs1, rhs2, options=nothing)
end

push!(exprs, expr)

# Fix method ambiguity error on NaNMath >= 1.0.2 and promotion of `Integer`s on NaNMath < 1.0.2
if f === NaNMath.pow
push!(exprs, :((f::$(typeof(f)))(a::$T, b::Integer) = ($assert_like(f, Number, a); $term($(^), a, b))))
end
end

for f in (skip_basics ? monadic : only_basics ? basic_monadic : vcat(basic_monadic, monadic))
Expand Down
Loading