Add unsupported language detection to the STJ source generator#87950
Merged
eiriktsarpalis merged 3 commits intodotnet:mainfrom Jun 23, 2023
Merged
Add unsupported language detection to the STJ source generator#87950eiriktsarpalis merged 3 commits intodotnet:mainfrom
eiriktsarpalis merged 3 commits intodotnet:mainfrom
Conversation
… and emit error diagnostics.
|
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue DetailsThis PR:
It should be noted that the minimum supported language version for STJ is C# 9. This is because a number of "JsonMetadataServices" models use init-only properties.
|
eiriktsarpalis
commented
Jun 23, 2023
| using System; | ||
| using System.Text.Json.Serialization; | ||
|
|
||
| [assembly: JsonSerializable(typeof(int))] |
Member
Author
There was a problem hiding this comment.
This (and a number of other unit tests) are calling early source gen APIs that were eventually removed before the SG was shipped.
eiriktsarpalis
commented
Jun 23, 2023
| using System.Collections.Generic; | ||
| using System.Text.Json.Serialization; | ||
|
|
||
| [assembly: JsonSerializable(typeof(Fake.Location))] |
Member
Author
There was a problem hiding this comment.
Removing test using a deprecated activation gesture that no longer compiles succesfully.
krwq
reviewed
Jun 23, 2023
krwq
reviewed
Jun 23, 2023
krwq
reviewed
Jun 23, 2023
...on/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorDiagnosticsTests.cs
Show resolved
Hide resolved
krwq
reviewed
Jun 23, 2023
...tem.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs
Show resolved
Hide resolved
krwq
approved these changes
Jun 23, 2023
layomia
reviewed
Jun 23, 2023
src/libraries/System.Text.Json/gen/JsonSourceGenerator.DiagnosticDescriptors.cs
Show resolved
Hide resolved
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR:
It should be noted that the minimum supported language version for STJ is C# 9. This is because a number of "JsonMetadataServices" models use init-only properties.