Uh oh!
There was an error while loading. Please reload this page.
Add sourcegen support for required & init-only properties. - #79828
Conversation
ghost
commented
Dec 19, 2022
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue DetailsUpdates the source generator to include support for publicclassMyPoco{publicrequiredintX{get;set;}publicintY{get;init;}}The source generator will now generate metadata treating ObjectWithParameterizedConstructorCreator=static(args)=>newMyPoco(){X=(int)args[0],Y=(int)args[1]}Fix #58770.
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Removes any async void declarations per https://learn.microsoft.com/en-us/archive/msdn-magazine/2013/march/async-await-best-practices-in-asynchronous-programming#avoid-async-void
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
7559955 to
9a61644CompareThe test failures appear to be impacting release builds of wasm only. I'm able to reproduce the failures locally, and all seem related to an issue in which |
layomia
commented
Dec 21, 2022
Sounds like the options configuration/instances might not be flowing through properly following the change to move the fast-path decision logic to the context (or just how the context/options are being instantiated). Since individual runs pass my mind also goes to threading issues with the options caching optimizations added in .NET 7. Not sure if these were considered but wanted to mention. |
eiriktsarpalis
commented
Dec 21, 2022
Had the same thought, but the errors keep popping up even with global caching disabled. Something stranger than that is happening. I've been able to isolate the test failures to using the Steps to reproduce (on WSL) : ./build.sh -os Browser -configuration Release && ./dotnet.sh build -t:Test src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/System.Text.Json.SourceGeneration.Roslyn4.4.Tests.csproj \
-p:TargetOS=Browser -p:TargetArchitecture=wasm -p:Configuration=Release |
eiriktsarpalis
commented
Dec 23, 2022
PR blocked until #79943 can be addressed. |
9a61644 to
81986b9Compareeiriktsarpalis
commented
Jan 9, 2023
Given that #79943 has been fixed, rebasing changes to see if it resolves CI issues. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Updates the source generator to include support for
requiredandinitproperties. This is done by piggybacking on the existing parameteric constructor infrastructure using property initializer syntax. For example, given the following type:The source generator will now generate metadata treating
XandYas pseudo-constructor parameters and emit a delegate as follows:Fix#58770.