-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Conversation
There was a problem hiding this 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.
Tagging subscribers to this area: @dotnet/area-extensions-configuration |
There was a problem hiding this 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})", |
...ries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/GeneratorTests.cs
Outdated
Show resolved
Hide resolved
|
||
// 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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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:
Line 1029 in 27604b5
byte[] referencedImage = CompilationHelper.CreateAssemblyImage(referencedCompilation); |
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.
Fix #115133