Skip to content

Commit 312a1f7

Browse files
Generalize conversion of Number to Operation
1 parent cdd0237 commit 312a1f7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/operations.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ function find_replace!(O::Operation,x::Variable,y::Expression)
3636
end
3737

3838
# For inv
39-
Base.convert(::Type{Operation}, x::Int) = Operation(identity, Expression[Constant(x)])
40-
Base.convert(::Type{Operation}, x::Bool) = Operation(identity, Expression[Constant(x)])
39+
Base.convert(::Type{Operation}, x::Number) = Operation(identity, Expression[Constant(x)])
4140
Base.convert(::Type{Operation}, x::Operation) = x
4241
Base.convert(::Type{Operation}, x::Expression) = Operation(identity, Expression[x])
4342
Operation(x) = convert(Operation, x)

0 commit comments

Comments
 (0)