Skip to content

Commit cdcf425

Browse files
authored
Merge pull request #92 from JuliaSymbolics/s/fix-lf
fix literal functions with > 2 arguments
2 parents 2e743f1 + 7a5dca4 commit cdcf425

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/types.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Base.show(io::IO, v::Sym) = print(io, v.name)
144144
# Maybe don't even need a new type, can just use Sym{FnType}
145145
struct FnType{X<:Tuple,Y} end
146146

147-
(f::Sym{<:FnType})(args...) = term(f, args...)
147+
(f::Sym{<:FnType})(args...) = Term{promote_symtype(f, symtype.(args)...)}(f, [args...])
148148

149149
function (f::Sym)(args...)
150150
error("Sym $f is not callable. " *

test/basics.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ using Test
2626
@test_throws ErrorException g(b, a)
2727

2828
@test symtype(g(b, f)) === Int
29+
30+
# issue #91
31+
@syms h(a,b,c)
32+
@test isequal(h(1,2,3), h(1,2,3))
2933
end
3034
end
3135

0 commit comments

Comments
 (0)