Skip to content

Commit d3dcdde

Browse files
committed
Update Term constructor
1 parent a7fd87a commit d3dcdde

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/types.jl

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -293,16 +293,15 @@ function _Sym(::Type{T}, name::Symbol; kwargs...) where {T}
293293
BasicSymbolic{T}(; impl, kwargs...)
294294
end
295295

296-
function Term{T}(f, args; kw...) where T
297-
if eltype(args) !== Any
298-
args = convert(Vector{Any}, args)
296+
function _Term(::Type{T}, f, args; kwargs...) where {T}
297+
if eltype(args) !== BasicSymbolic
298+
args = convert(Vector{BasicSymbolic}, args)
299299
end
300-
301-
Term{T}(;f=f, arguments=args, hash=Ref(UInt(0)), kw...)
300+
impl = Term(f, args)
301+
BasicSymbolic{T}(; impl, kwargs...)
302302
end
303-
304-
function Term(f, args; metadata=NO_METADATA)
305-
Term{_promote_symtype(f, args)}(f, args, metadata=metadata)
303+
function _Term(f, args; kwargs...)
304+
_Term(_promote_symtype(f, args), f, args; kwargs...)
306305
end
307306

308307
function Add(::Type{T}, coeff, dict; metadata=NO_METADATA, kw...) where T

0 commit comments

Comments
 (0)