Skip to content

Commit bf23a1d

Browse files
Merge pull request #690 from devmotion/patch-1
Fix method ambiguity error of `NaNMath.pow`
2 parents e577714 + 82d8e3e commit bf23a1d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/methods.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ function number_methods(T, rhs1, rhs2, options=nothing)
7777
end
7878

7979
push!(exprs, expr)
80+
81+
# Fix method ambiguity error on NaNMath >= 1.0.2 and promotion of `Integer`s on NaNMath < 1.0.2
82+
if f === NaNMath.pow
83+
push!(exprs, :((f::$(typeof(f)))(a::$T, b::Integer) = ($assert_like(f, Number, a); $term($(^), a, b))))
84+
end
8085
end
8186

8287
for f in (skip_basics ? monadic : only_basics ? basic_monadic : vcat(basic_monadic, monadic))

0 commit comments

Comments
 (0)