unused parameters in parsers#544
Conversation
Summary of ChangesHello @KostinPavel, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on code hygiene by explicitly marking several function and lambda parameters as unused across various parser and validation components within the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request aims to address unused parameters in several parser files. The changes are mostly correct, marking unused parameters to avoid compiler warnings. However, I found a critical issue in FieldVariantParser.hpp where a parameter is marked as unused but is actually used, which will lead to a compilation error. Additionally, a default argument for another parameter was incorrectly removed. My review includes a suggestion to fix these issues.
| std::map<std::string, schema::Type>* /*_definitions*/, | ||
| std::vector<schema::Type> /*_types = {}*/) { | ||
| using VariantType = rfl::Variant<NamedTuple<FieldTypes>...>; | ||
| return Parser<R, W, VariantType, ProcessorsType>::to_schema(_definitions); |
There was a problem hiding this comment.
There are a couple of issues with the changes to this function signature:
- The parameter
_definitionsis marked as unused by commenting out its name, but it is used on line 78. This will cause a compilation error. - The default value for the
_typesparameter has been commented out. This changes the function's signature and can break existing calls that rely on the default argument.
To fix this, you should restore the name for _definitions and only comment out the name for _types, keeping its default value.
| std::map<std::string, schema::Type>* /*_definitions*/, | |
| std::vector<schema::Type> /*_types = {}*/) { | |
| using VariantType = rfl::Variant<NamedTuple<FieldTypes>...>; | |
| return Parser<R, W, VariantType, ProcessorsType>::to_schema(_definitions); | |
| std::map<std::string, schema::Type>* _definitions, | |
| std::vector<schema::Type> /*_types*/ = {}) { | |
| using VariantType = rfl::Variant<NamedTuple<FieldTypes>...>; | |
| return Parser<R, W, VariantType, ProcessorsType>::to_schema(_definitions); |
unused parameters in parsers