Skip to content

Conversation

@jacobperron
Copy link

The first commit demonstrates the issue and fails to compile on it's own 0509f1c

The second commit proposes a fix by using fully qualified names for action types 5163571

And the third commit adds a simple unit test for sanity ba85bd1

Note, this issue does not appear to affect services, it was only an issue in the action code generator.

I.e. try to generate code for Nested.action that contains members of type Nested.msg.

This commit will not compile as-is, demonstrating a bug in the Java code generator.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
If we have an action that has a nested message and both use the same basename, then the Java compiler cannot resolve the two different types.
The solution is to fully qualify the action name wherever it is used.

This change also splits the 'marker_interfaces' variable into two variables, 'imports' and 'implements', in an effort to simplify the code templates.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Copy link
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me, using the full type names to avoid ambiguity.

@jacobperron jacobperron merged commit c6a339d into main Sep 28, 2022
@jacobperron jacobperron deleted the jacob/fix_nested_action branch September 28, 2022 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants