From 81d67e432b5b0a3be19c666d46ade38378eee448 Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Tue, 27 Feb 2024 14:19:14 +0000 Subject: [PATCH] Earlier error message --- src/diff.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diff.jl b/src/diff.jl index 5671e11d1..8e627b56c 100644 --- a/src/diff.jl +++ b/src/diff.jl @@ -32,7 +32,7 @@ julia> D3 = Differential(x)^3 # 3rd order differential operator struct Differential <: Operator """The variable or expression to differentiate with respect to.""" x::BasicSymbolic - function Differential(x) + function Differential(x::BasicSymbolic) vx = value(x) SymbolicUtils.exprtype(vx) == SymbolicUtils.SYM || throw(ArgumentError("Must differentiate with respect to a symbol, got $vx")) new(vx)