Skip to content

Commit decc3f3

Browse files
committed
Fix duplicate method definition
1 parent 01dd15e commit decc3f3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/register_function.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,14 @@ macro register(expr, Ts = [Num, Symbolic, Real])
4545
end
4646
end)
4747
end
48-
push!(ex.args, :((::$typeof($promote_symtype))(::$typeof($f), args...) = $ret_type))
48+
push!(
49+
ex.args,
50+
quote
51+
if $!($hasmethod($promote_symtype, $Tuple{$typeof($f), $Vararg}))
52+
(::$typeof($promote_symtype))(::$typeof($f), args...) = $ret_type
53+
end
54+
end
55+
)
4956
esc(ex)
5057
end
5158

0 commit comments

Comments
 (0)