Anonymous type definitions are not allowed #138
-
|
I have an IDL file like this: I get |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
The short answer is no, RIDL doesn't support anonymous types, you must use a typedef in your IDL. The longer answer is that IDL3 deprecated anonymous types because it is problematic in some language mappings, see IDL3.5 chapter 5.11.6. Anonymous types are problematic in some language mappings, for example in the IDL to C++11 mapping. In that language mapping we declare a At some point the DDS vendors decided that they do want to support anonymous types, they only use a subset of IDL. With the definition of IDL4 anonymous types where added back as part of an optional building block. They completely ignored the fact that this is problematic, but their scope and usage of IDL is very limited. Because the available open source backends of RIDL don't support anonymous types we added the error checking for anonymous types to the RIDL frontend. At some point we discussed migrating those checks to the various backends but that is very very low on the priority list. The easiest and best solution is to introduce typedefs, that makes your IDL more clean and it will work with any language mapping. |
Beta Was this translation helpful? Give feedback.
The short answer is no, RIDL doesn't support anonymous types, you must use a typedef in your IDL.
The longer answer is that IDL3 deprecated anonymous types because it is problematic in some language mappings, see IDL3.5 chapter 5.11.6. Anonymous types are problematic in some language mappings, for example in the IDL to C++11 mapping. In that language mapping we declare a
IDL::traits<>specialization for your types, but we can't do that for yoursequence<ColorT>. Also a lot of questions arise when we use distinct types, what when you use the same anonymous type in different modules, is that the same type or not? Because of this the CORBA vendors in the past deprecated anonymous types.At s…