Skip to content

Commit d53907e

Browse files
author
Brad Carman
committed
add bool to promote_to_concrete
1 parent 6e70763 commit d53907e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/utils.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ function promote_to_concrete(vs; tofloat = true, use_union = true)
660660
I = Int8
661661
has_int = false
662662
has_array = false
663+
has_bool = false
663664
array_T = nothing
664665
for v in vs
665666
if v isa AbstractArray
@@ -672,6 +673,9 @@ function promote_to_concrete(vs; tofloat = true, use_union = true)
672673
has_int = true
673674
I = promote_type(I, E)
674675
end
676+
if E <: Bool
677+
has_bool = true
678+
end
675679
end
676680
if tofloat && !has_array
677681
C = float(C)
@@ -682,6 +686,9 @@ function promote_to_concrete(vs; tofloat = true, use_union = true)
682686
if has_int
683687
C = Union{C, I}
684688
end
689+
if has_bool
690+
C = Union{C, Bool}
691+
end
685692
return copyto!(similar(vs, C), vs)
686693
end
687694
convert.(C, vs)

0 commit comments

Comments
 (0)