-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Split Reflection and SourceGen TypeInfos #67526
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,7 +167,7 @@ internal JsonTypeInfo() | |
Debug.Assert(false, "This constructor should not be called."); | ||
} | ||
|
||
internal JsonTypeInfo(Type type, JsonSerializerOptions options!!, bool dummy) | ||
internal JsonTypeInfo(Type type, JsonSerializerOptions options!!) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we remove this constructor altogether? IIRC all instantiation paths for JsonTypeInfo require There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. technically I could do further refactoring to keep just single constructor but I prefer to keep it separate because need to make sure this will still work correctly with source gen which makes it a bit convoluted |
||
{ | ||
Type = type; | ||
Options = options; | ||
|
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: probably fine for the scope of this PR, but eventually I'd like to see this method moved out of
JsonSerializerOptions
responsibility.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.
most of the work this does is checking if the type is complete generic type so essentially I'd need to duplicate that logic elsewhere, we previously could have it as part of JsonTypeInfo because it wasn't generic but now we cannot instantiate it otherwise