Skip to content

Commit

Permalink
promote_type stack overflow fix (#161)
Browse files Browse the repository at this point in the history
* promote_type stack overflow fixed

* promote_type stack overflow fixed

* Update src/interfaces.jl

---------

Co-authored-by: Jinguo Liu (刘金国) <cacate0129@gmail.com>
  • Loading branch information
ArrogantGao and GiggleLiu committed Jan 4, 2024
1 parent 96582cc commit 01a6bfa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/interfaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function get_size_dict_unary!(ix, s, size_info::Dict{LT}) where LT
end

@inline function get_size_dict(ixs, xs, size_info=nothing)
LT = promote_type(eltype.(ixs)...)
LT = foldl((a, b) -> promote_type(a, eltype(b)), ixs; init=Union{})
return get_size_dict!(ixs, xs, size_info===nothing ? Dict{LT,Int}() : size_info)
end

Expand Down

0 comments on commit 01a6bfa

Please sign in to comment.