Closed saarnold closed 8 years ago
And I guess that it is intentional that it checks for equal member types and offsets and doesn't check the name of the type.
Mmmm... maybe not that intentional. However, it would be too ingrained to change the behaviour of #== right now.
The preferred solution for me would be to override Type.eql?
in typelib (which in ruby is a stronger #==
) so that eql?
checks for both name and ==
(e.g. def eql?(type); self == type && type.name == name end
), and use #eql?
instead of #==
here. Explicitely checking on name feels really too horrible.
I did change it to use eql?
and added a corresponding PR to typelib orocos-toolchain/typelib#75
ping
Merged. Sorry for the delay
Currently opaque type equality is checked using the == operator which calls
do_compare
in typelib. And I guess that it is intentional that it checks for equal member types and offsets and doesn't check the name of the type.But in the case two opaques are defined having the same members. E.g.:
they currently both resolve in the same opaque type ClassA. So I think comparing the type name instead of the type would be the right thing to do here.