Skip to content
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

avoid log errors when type is missing but config is initialized #35

Merged
merged 4 commits into from
Nov 14, 2024

Conversation

nathanhhughes
Copy link
Collaborator

Small tweak to avoid the logger complaining when a virtual config is default initialized but not specified in the YAML config being loaded

Copy link
Collaborator

@Schmluk Schmluk left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -206,13 +206,14 @@ void declare_config(VirtualConfig<BaseT>& config) {
auto data = internal::Visitor::visitVirtualConfig(config.isSet(), config.optional_, config.getType());

// If setting values create the wrapped config using the string identifier.
const bool type_optional = config.optional_ || config.config_;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it make sense to add a brief comment which case is handled here (for future reference)? I think this does the right thing but not immediately clear to me when reading that the config being set makes it optional.

@nathanhhughes nathanhhughes merged commit 83595cb into main Nov 14, 2024
2 checks passed
@nathanhhughes nathanhhughes deleted the fix/default_virtual_config_error branch November 14, 2024 18:06
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.

2 participants