-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Fix allow passing a default argument when InputOption::IS_NEGATABLE
is used
#52058
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 6.4
Are you sure you want to change the base?
Conversation
1aa455d
to
ba2f4a5
Compare
I'm not sure I understand the purpose. Why don't you use |
InputOption::IS_NEGATABLE
is used
I think passing an option for the negatable case does make sense, since it basically ensures the option resolves as boolean instead of nullable boolean, which could be useful or at least clearer in some applications. I do admit it looks slightly off when combined with an explicit So given this, I would expect |
ba2f4a5
to
f4692c3
Compare
Retargeted to |
we should probably validate also that the default value of a negatable option is a boolean. However, this looks more like a new feature than a bugfix to me, so it should probably go in 7.4. |
(Encountered on test run for #52055)
Currently, the following call/construction of an
InputOption
is valid:while the following call is not
To me, this seems inconsistent, as I would expect both calls to behave in exactly the same manner. This PR ensures both calls are equally valid.
Note: a follow-up might be ensuring the passed default value is boolean when using
InputOption::VALUE_NEGATABLE
; I can add that to #52055 once this is merged.