You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately the current tests for structure padding #25908 do not recurse down the type hierarchy, i.e. #27877 is incomplete. Sorry, I should have thought about that possibility when @Keno first introduced the padding machinery :(
julia> struct padded
a::Bool
b::UInt32
end
julia> struct wrapped
x::padded
end
julia> a=collect(1:2); r=reinterpret(wrapped, a); r[2]=r[1];
julia> a
2-element Array{Int64,1}:
1
16541441
The text was updated successfully, but these errors were encountered:
yep, this was discussed and we should extend the padding mechanism to handle this, but we considered just getting the simple thing in first better than nothing.
The padding checks in #47116 properly recurses nested structures, but I don't believe the array reinterpret code is using it right now. It does, just not when it's being created.
However, the example in the OP currently results in a padding error during setindex! on 1.10-rc2.
I think this is by design then - the example ReinterpretArray is deemed readable but not writable, because it's reading the padding properly. So this issue can probably be closed.
Unfortunately the current tests for structure padding #25908 do not recurse down the type hierarchy, i.e. #27877 is incomplete. Sorry, I should have thought about that possibility when @Keno first introduced the padding machinery :(
The text was updated successfully, but these errors were encountered: