Skip to content

Commit ad6dff7

Browse files
committed
Update _promote_symtype
1 parent d3dcdde commit ad6dff7

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/types.jl

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -915,18 +915,16 @@ end
915915
function _promote_symtype(f, args)
916916
if issym(f)
917917
promote_symtype(f, map(symtype, args)...)
918+
elseif length(args) == 0
919+
promote_symtype(f)
920+
elseif length(args) == 1
921+
promote_symtype(f, symtype(args[1]))
922+
elseif length(args) == 2
923+
promote_symtype(f, symtype(args[1]), symtype(args[2]))
924+
elseif isassociative(f)
925+
mapfoldl(symtype, (x, y) -> promote_symtype(f, x, y), args)
918926
else
919-
if length(args) == 0
920-
promote_symtype(f)
921-
elseif length(args) == 1
922-
promote_symtype(f, symtype(args[1]))
923-
elseif length(args) == 2
924-
promote_symtype(f, symtype(args[1]), symtype(args[2]))
925-
elseif isassociative(f)
926-
mapfoldl(symtype, (x,y) -> promote_symtype(f, x, y), args)
927-
else
928-
promote_symtype(f, map(symtype, args)...)
929-
end
927+
promote_symtype(f, map(symtype, args)...)
930928
end
931929
end
932930

0 commit comments

Comments
 (0)