Skip to content

Commit 62efff0

Browse files
committed
Fix tests
1 parent 971c739 commit 62efff0

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/methods.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,12 @@ for (f, Domain) in [(==) => Number, (!=) => Number,
134134
end
135135
end
136136

137-
Base.:!(s::Symbolic{Bool}) = Term{Bool}(!, [s])
138-
Base.:~(s::Symbolic{Bool}) = Term{Bool}(!, [s])
137+
for f in [!, ~]
138+
@eval begin
139+
promote_symtype(::$(typeof(f)), ::Type{<:Bool}) = Bool
140+
(::$(typeof(f)))(s::Symbolic{Bool}) = Term{Bool}(!, [s])
141+
end
142+
end
139143

140144

141145
# An ifelse node, ifelse is a built-in unfortunately

src/types.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ end
299299

300300
function term(f, args...; type = nothing)
301301
if type === nothing
302-
T = rec_promote_symtype(f, symtype.(args)...)
302+
T = rec_promote_symtype(f, map(symtype, args)...)
303303
else
304304
T = type
305305
end
@@ -313,7 +313,7 @@ Create a term that is similar in type to `t` such that `symtype(similarterm(f,
313313
args...)) === symtype(f(args...))`.
314314
"""
315315
similarterm(t, f, args) = f(args...)
316-
similarterm(::Term, f, args) = Term(f, args)
316+
similarterm(::Term, f, args) = term(f, args...)
317317

318318
node_count(t) = istree(t) ? reduce(+, node_count(x) for x in arguments(t), init=0) + 1 : 1
319319

0 commit comments

Comments
 (0)