eclipse-cyclonedds / cyclonedds-python

Other
54 stars 44 forks source link

The command "cyclonedds typeof" fails to reconstruct the IDL of a derived topic #241

Closed adrianomarto closed 2 months ago

adrianomarto commented 3 months ago

I got a crash whilst running the command "cyclonedds typeof Derived".

Here is the IDL:

module Hierarchy { @mutable struct Base { string fieldA; };

struct Derived : Base { string fieldB; }; };

Here is the stack-trace:

Exception in thread Thread-1 (type_discovery): Traceback (most recent call last): File "/usr/lib64/python3.11/threading.py", line 1038, in _bootstrap_inner self.run() File "/usr/lib64/python3.11/threading.py", line 975, in run self._target(*self._args, *self._kwargs) File "/usr/lib64/python3.11/site-packages/cyclonedds/tools/cli/discovery/main.py", line 281, in typediscovery datatype, = dynamic.get_types_for_typeid( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.11/site-packages/cyclonedds/dynamic.py", line 69, in get_types_for_typeid return XTInterpreter.xt_to_class(type_id, typemap) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.11/site-packages/cyclonedds/idl/_xt_builder.py", line 1458, in xt_to_class main_type = cls._from_typeid(ident, state) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.11/site-packages/cyclonedds/idl/_xt_builder.py", line 1503, in _from_typeid return cls._from_typeobject(ident, state) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.11/site-packages/cyclonedds/idl/_xt_builder.py", line 1524, in _from_typeobject return cls._make_complete_struct(ident, complete_obj.struct_type, state) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.11/site-packages/cyclonedds/idl/_xt_builder.py", line 1592, in _make_complete_struct struct = make_idl_struct( ^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.11/site-packages/cyclonedds/idl/init.py", line 39, in make_idl_struct bases = tuple(list(bases) + [IdlStruct]) ^^^^^^^^^^^^ TypeError: 'IdlMeta' object is not iterable

adrianomarto commented 3 months ago

I created the pull request #242 to demonstrate this issue.