What to do with `Array` now that it has fields ?
while testing #86 , some downstream packages (Flatten.jl) fail because now Array{N,T} has fields (size::NTuple{Int,N} and ref::MemoryRef{T}). is this something that needs to be fixed on Flatten or ConstructionBase?
We have getproperties([]) == () so getproperties and setproperties should be consistent with that, e.g. not see the fields. About constructorof and getfields should be aware of them OTOH.
See also
- https://juliaobjects.github.io/ConstructionBase.jl/dev/#the-raw-level
- https://juliaobjects.github.io/ConstructionBase.jl/dev/#the-semantic-level
Does the constrictor Array(size, ref) work?
And do you have a link to the break in Flatten.jl?
(We may need a costom constructorof here)
Does the constrictor
Array(size, ref)work?
No, Array(ref, size) does not work. Still, I think we should provide it. To me, one aspect of this package is to provide a constructor from fields no matter what. We do this in many other cases even lambda functions.
Yeah, absolutely. We can define a custom constructorof for Array.
provide a constructor from fields no matter what
Yes, nice to have it whenever possible. Ie, constructorof(array)(getfields(A)) won't work on 1.10- because it doesn't have any fields, but will on 1.11.
Yeah, it will need to be in a @static check on Julia version