Skip to content

Commit

Permalink
add inference test
Browse files Browse the repository at this point in the history
Update broadcast.jl
  • Loading branch information
N5N3 committed Dec 16, 2021
1 parent 42c3642 commit a6955f0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,9 @@ let
bc = Broadcasted(+, (Broadcasted(*, (1, Broadcasted(/, (2.0, 2.5)))), Broadcasted(*, (Broadcasted(*, (3, 4)), 5))))
@test @inferred(Broadcast.cat_nested(bc)) == (1,2.0,2.5,3,4,5)
@test @inferred(Broadcast.materialize(Broadcast.flatten(bc))) == @inferred(Broadcast.materialize(bc)) == 60.8
# 1 .* 1 .- 1 .* 1 .^2 .+ 1 .* 1 .+ 1 .^ 3
bc = Base.Broadcast.Broadcasted(+, (Base.Broadcast.Broadcasted(+, (Base.Broadcast.Broadcasted(-, (Base.Broadcast.Broadcasted(*, (1, 1)), Base.Broadcast.Broadcasted(*, (1, Base.Broadcast.Broadcasted(Base.literal_pow, (Base.RefValue{typeof(^)}(^), 1, Base.RefValue{Val{2}}(Val{2}()))))))), Base.Broadcast.Broadcasted(*, (1, 1)))), Base.Broadcast.Broadcasted(Base.literal_pow, (Base.RefValue{typeof(^)}(^), 1, Base.RefValue{Val{3}}(Val{3}())))))
@test @inferred(Broadcast.materialize(Broadcast.flatten(bc))) == @inferred(Broadcast.materialize(bc)) == 2
end

let
Expand Down

0 comments on commit a6955f0

Please sign in to comment.