Skip to content

Commit 2d35635

Browse files
Fix more edge cases
1 parent b13cb14 commit 2d35635

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/DataLayouts/non_extruded_broadcasted.jl

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ end
9595
# getindex on DefaultArrayStyle{0} ignores the
9696
# index value, so this should always be safe
9797
@inline Base.checkbounds(bc::NonExtrudedBroadcasted{Style}, I::Union{Integer, CartesianIndex{0}}) where {Style <: Base.Broadcast.DefaultArrayStyle{0}} = nothing
98+
@inline Base.checkbounds(bc::NonExtrudedBroadcasted{Style}, I::Union{Integer, CartesianIndex{0}}) where {Style <: Base.Broadcast.Style{Tuple}} = nothing
9899

99100

100101
# To handle scalar cases, let's just switch back to

test/DataLayouts/unit_non_extruded_broadcast.jl

+3-2
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,12 @@ end
7575
cspace = Spaces.CenterFiniteDifferenceSpace(z_topology)
7676
f = Fields.Field(FT, cspace)
7777
@. f = FT(2.0)
78+
tup = (2.0,)
79+
@. f = tup
7880
bc = @lazy @. f = FT(2.0)
7981
bc = Base.Broadcast.instantiate(bc)
8082
bc = DataLayouts.to_non_extruded_broadcasted(bc)
81-
# @test bc[1] == FT(2.0)
82-
# @test bc[2] == FT(2.0)
83+
@test bc[] == 2.0
8384
end
8485

8586
@testset "Conceptual test (to compare against Base)" begin

0 commit comments

Comments
 (0)