Skip to content

Fix config source gen with value tuple #115233

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

Merged
merged 3 commits into from
May 2, 2025

Conversation

tarekgh
Copy link
Member

@tarekgh tarekgh commented May 1, 2025

Fix #115133

@Copilot Copilot AI review requested due to automatic review settings May 1, 2025 22:46
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-extensions-configuration
See info in area-owners.md if you want to be subscribed.

@tarekgh tarekgh added this to the 10.0.0 milestone May 1, 2025
Copy link
Member

@ericstj ericstj left a comment

Choose a reason for hiding this comment

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

LGTM
I checked to see what Json does and it has similar special casing for ValueTuple

{ IsValueTuple: true } => $"() => default({typeSpec.TypeRef.FullyQualifiedName})",


// Ensure the generated code can be compiled.
// If there is any compilation error, exception will be thrown with the list of the errors in the exception message.
byte[] emittedAssemblyImage = CreateAssemblyImage(result.OutputCompilation);
Copy link
Member

Choose a reason for hiding this comment

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

Interesting this is the first time we're compiling the generator output -- we didn't have any other patterns to follow here for validating this?

Copy link
Member Author

@tarekgh tarekgh May 1, 2025

Choose a reason for hiding this comment

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

We do in other places, for example:

used to compile and run the generated code. In my case I wanted to validate it compile fine. This is used also in other generators too like regex and json.

@tarekgh tarekgh merged commit cb3f507 into dotnet:main May 2, 2025
83 of 85 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Binding source generator emits bad code for tuples
2 participants