Update pragma warning disables to SuppressMessage attributes#636
Merged
gregsdennis merged 8 commits intoJan 29, 2024
Merged
Conversation
Sergio0694
reviewed
Jan 29, 2024
gregsdennis
reviewed
Jan 29, 2024
gregsdennis
reviewed
Jan 29, 2024
gregsdennis
reviewed
Jan 29, 2024
gregsdennis
reviewed
Jan 29, 2024
| public static JsonConverter<T> GetConverter<T>(this JsonSerializerOptions options, JsonTypeInfo? typeInfo = null) | ||
| public static JsonConverter<T> GetConverter<T>(this JsonSerializerOptions options, JsonTypeInfo? typeInfo) | ||
| { | ||
| #if NET8_0_OR_GREATER |
There was a problem hiding this comment.
It seems that targets older than 8.0 ignore the typeInfo argument?
Collaborator
There was a problem hiding this comment.
Yeah, .Net Standard's version doesn't have a .Converter property on JsonTypeInfo, so we need to just get it off of the options.
There was a problem hiding this comment.
Gotcha. Would it make sense to add a debug assertion?
Debug.Assert(typeInfo is null || typeInfo.Options == options);Or perhaps even make it a runtime check given that it's public API?
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The downstream AOT callers can't see our #pragma warning disables. Need to use attributes so that people compiled against the library don't get messages about things we suppressed.
@Sergio0694 can you take a peek too?