Skip to content

Commit

Permalink
Try changing promotion hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisYatunin committed Aug 21, 2024
1 parent e006de9 commit e530487
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/BitSequence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@ end

target_output_type(::BitSequence{<:Any, U}) where {U} = BitSequence{<:Any, U}

output_promote_rule(::Type{B}, ::Type{O}) where {B <: BitSequence, O} = O
output_promote_rule(::Type{B}, ::Type{Tuple}) where {B <: BitSequence} = Tuple
output_promote_rule(::Type{B}, ::Type{LazySequence}) where {B <: BitSequence} =
B
output_promote_rule(::Type{B}, ::Type{O}) where {B <: BitSequence, O} = B

eltype_restriction(::Type{<:BitSequence}) = Bool

Expand Down
8 changes: 4 additions & 4 deletions src/unrollable_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ Only one method of `output_promote_rule` needs to be defined for any given pair
of output types.
The built-in promotion rules are
[`LazySequence`](@ref UnrolledUtilities.LazySequence) <
[`BitSequence`](@ref UnrolledUtilities.BitSequence) < `Tuple` < `Any`. By
default, the result for any other pair of distinct output types is `Union{}`.
[`LazySequence`](@ref UnrolledUtilities.LazySequence) < `Tuple` < `Any` <
[`BitSequence`](@ref UnrolledUtilities.BitSequence). By default, the result for
any other pair of distinct output types is `Union{}`.
"""
output_promote_rule(::Type, ::Type) = Union{}
output_promote_rule(::Type{O}, ::Type{O}) where {O} = O
output_promote_rule(::Type{O}, ::Type{Tuple}) where {O} = O
output_promote_rule(::Type{Tuple}, ::Type{O}) where {O} = O

@inline function output_promote_result(O1, O2)
O12 = output_promote_rule(O1, O2)
Expand Down

0 comments on commit e530487

Please sign in to comment.