Check signal name only for signals #626
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a bug in
rinf gen
(present in v8.7.0) where name conflicts between signal and non-signal structs/enums in different modules cause generation to abort, depending on module processing order.Problem
In Rinf v8.7.0, the
rinf gen
command fails when a signal struct or enum shares the same name as a non-signal struct or enum in another module. This occurs only if the signal's module is processed before the non-signal's module. The processing order appears to be filesystem-dependent (e.g., alphabetical or OS-specific directory listing), leading to inconsistent behavior across environments.For example:
SomeRequest
inmodule1.rs
(marked as a signal).SomeRequest
inmodule2.rs
(not a signal).If
module1
is processed first,rinf gen
aborts with:If
module2
is processed first, generation succeeds without issues.Fix
rust_crate_cli/src/tool/generate.rs
to perform uniqueness checks only after confirming that a struct or enum is indeed a signal (previously, checks occurred before this confirmation).