JuliaIO / MAT.jl

Julia module for reading MATLAB files
MIT License
280 stars 71 forks source link

Improve `CompositeKind` handling #174

Open BambOoxX opened 2 years ago

BambOoxX commented 2 years ago

The current behavior for CompositeKind data is https://github.com/JuliaIO/MAT.jl/blob/355bd1a901730ad5713b3283f6ec66603c72dfd9/src/MAT_HDF5.jl#L529-L536

however, there are issues with the isbits(s) test, reported in #162,#143 or with simple user types such as

struct MyType
    field1::Int64
    field2::Int64
end

While these types are clearly isbitstypes, I do not see a reason to not allow their conversion the equivalent matlab struct. Given https://github.com/JuliaIO/MAT.jl/blob/355bd1a901730ad5713b3283f6ec66603c72dfd9/src/MAT_HDF5.jl#L535 The requirement seems more to be that fieldcount(T) > 0, regardless of the actual bits type.

Can someone confirm this ?

BambOoxX commented 6 months ago

Bump ?