-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Update binder gen parser to issue diagnostics for invalid input types #86856
Conversation
Tagging subscribers to this area: @dotnet/area-extensions-configuration Issue Detailsnull
|
AddRootConfigType(methodGroup: BinderMethodSpecifier.Bind, overload, namedType, binderOperation.Location); | ||
if (type.IsValueType) | ||
{ | ||
_context.ReportDiagnostic(Diagnostic.Create(Diagnostics.ValueTypesInvalidForBind, binderOperation.Location, type)); |
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.
Nit: adding a dependency on SourceProductionContext
in the parser means that its outputs can never be cached as incremental values. You should consider storing the Diagnostic
instances in an a temporary list to be incorporated in the model that gets passed down to the emitter.
...raries/Microsoft.Extensions.Configuration.Binder/gen/ConfigurationBindingGenerator.Parser.cs
Outdated
Show resolved
Hide resolved
...raries/Microsoft.Extensions.Configuration.Binder/gen/ConfigurationBindingGenerator.Parser.cs
Outdated
Show resolved
Hide resolved
80b2500
to
58ff1d5
Compare
No description provided.