Add special cases to coerce "1" and "0" to bool when using bool coercion only#651
Merged
methylDragon merged 3 commits intorollingfrom Sep 19, 2022
Merged
Add special cases to coerce "1" and "0" to bool when using bool coercion only#651methylDragon merged 3 commits intorollingfrom
methylDragon merged 3 commits intorollingfrom
Conversation
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
d9e3d43 to
bfb744c
Compare
Contributor
Author
60b0377 to
bfb744c
Compare
wjwwood
reviewed
Sep 17, 2022
Member
wjwwood
left a comment
There was a problem hiding this comment.
Makes sense to me, but I think @ivanpauno or @hidmic need to have a look, since they worked on this originally (I think). The coercion stuff is kind of tricky, so I could be missing something.
Signed-off-by: methylDragon <methylDragon@gmail.com>
emersonknapp
pushed a commit
to emersonknapp/launch
that referenced
this pull request
May 1, 2025
emersonknapp
pushed a commit
to emersonknapp/launch
that referenced
this pull request
May 1, 2025
…ion only (ros2#651) Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Exactly as the title says.
Given that "1" and "0" are valid true and false expressions according to the conditions, I think it makes sense to allow coercion of the "1" and "0" strings to
TrueandFalse.This ONLY affects coercion when
boolis explicitly passed to it. It's as small a change as possible.This supports the work in #649 and will be used to support the boolean substitution implementations.
Tests
Special note: This means that one test for the type coercion will no longer apply.
Beyond that, relevant tests have been implemented.