-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Description
The current behavior for CompositeKind
data is
Lines 529 to 536 in 355bd1a
# Write generic CompositeKind as a struct | |
function m_write(mfile::MatlabHDF5File, parent::HDF5Parent, name::String, s) | |
if isbits(s) | |
error("This is the write function for CompositeKind, but the input doesn't fit") | |
end | |
T = typeof(s) | |
m_write(mfile, parent, name, check_struct_keys([string(x) for x in fieldnames(T)]), [getfield(s, x) for x in fieldnames(T)]) | |
end |
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 isbitstype
s, I do not see a reason to not allow their conversion the equivalent matlab struct.
Given
Line 535 in 355bd1a
m_write(mfile, parent, name, check_struct_keys([string(x) for x in fieldnames(T)]), [getfield(s, x) for x in fieldnames(T)]) |
The requirement seems more to be that
fieldcount(T) > 0
, regardless of the actual bits type.
Can someone confirm this ?
Metadata
Metadata
Assignees
Labels
No labels