Skip to content

Commit b597d47

Browse files
authored
Merge pull request #87 from avik-pal/ap/empty_fix
2 parents 2eddcb7 + 3c6b131 commit b597d47

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Functors"
22
uuid = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
33
authors = ["Mike J Innes <mike.j.innes@gmail.com>"]
4-
version = "0.4.11"
4+
version = "0.4.12"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/walks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,6 @@ function (walk::FlattenWalk)(recurse, x, ys...)
315315
x_children = _values(children(x))
316316
ys_children = map(children, ys)
317317
res = _map(recurse, x_children, ys_children...)
318-
return reduce(vcat, _values(res))
318+
return reduce(vcat, _values(res); init = [])
319319
end
320320

test/basics.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,9 @@ end
439439
@test xflat isa Vector
440440
@test length(xflat) == 3
441441
@test 1 xflat && 2 xflat && [1, 2, 3] xflat
442+
443+
@test fleaves((;)) == []
444+
@test fleaves((; a = 1, b = 2, c = (;))) == [1, 2]
442445
end
443446

444447
@testset "fmap_with_path" begin

0 commit comments

Comments
 (0)