Skip to content

Commit

Permalink
Add a test and correct a typo
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloferz committed Dec 31, 2016
1 parent 5dbc334 commit ce7ebeb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ the following rules:
(and treats any `Ref` as a 0-dimensional array of its contents and any tuple
as a 1-dimensional array) expanding singleton dimensions.
The following additional rule apply to `Nullable` arguments:
The following additional rule applies to `Nullable` arguments:
- If there is at least a `Nullable`, and all the arguments are scalars or
`Nullable`, it returns a `Nullable` treating `Nullable`s as "containers".
Expand Down
6 changes: 6 additions & 0 deletions test/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -409,3 +409,9 @@ Base.Broadcast.broadcast_c(f, ::Type{Array19745}, A, Bs...) =
@test isa(aa .+ 1, Array19745)
@test isa(aa .* aa', Array19745)
end

# broadcast should only "peel" one container level
let io = IOBuffer()
broadcast(x -> print(io, x), [Nullable(1.0)])
String(take!(io)) == "Nullable{Float64}(1.0)"
end

0 comments on commit ce7ebeb

Please sign in to comment.