-
Notifications
You must be signed in to change notification settings - Fork 5.6k
ConfigurationBinder source generator shouldn't generate empty methods #92151
Copy link
Copy link
Closed
Labels
area-Extensions-ConfigurationenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is mergedsource-generatorIndicates an issue with a source generator featureIndicates an issue with a source generator feature
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
area-Extensions-ConfigurationenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is mergedsource-generatorIndicates an issue with a source generator featureIndicates an issue with a source generator feature
Description
I noticed the following empty method when reviewing the codegen for the repro in #91324
I tried this with an empty class, and it seems we'll skip that, so this might be more specific to collection initialization.
Reproduction Steps
Compile the repro in #91324 when setting
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>.Observe the generated code.
Expected behavior
Only meaninful methods are generated, methods that do nothing should be avoided.
Actual behavior
Method generated that merely enumerates the configuration children of section.
Regression?
No
Known Workarounds
No response
Configuration
No response
Other information
No response