From 6fcede0ce0c012c9481f2a1c500c6fc69a6ba9e5 Mon Sep 17 00:00:00 2001 From: Aaron Kaw Date: Wed, 4 Sep 2024 09:23:11 +1000 Subject: [PATCH] Test derivative throws for Function then non-Num input --- test/diff.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/diff.jl b/test/diff.jl index 23d9e837f..eb500cb9d 100644 --- a/test/diff.jl +++ b/test/diff.jl @@ -390,3 +390,11 @@ let ) end end + +# Check `Function` inputs throw for non-Num second input (#1085) +let + @testset for f in [sqrt, sin, acos, exp, cis] + @test_throws TypeError Symbolics.derivative(f, rand()) + @test_throws TypeError Symbolics.derivative(f, Val(rand(Int))) + end +end