Skip to content
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

Improved support for closures generated by Mono C# compiler #1561

Merged
merged 4 commits into from Jul 7, 2019

Conversation

Projects
None yet
1 participant
@siegfriedpammer
Copy link
Member

commented Jul 7, 2019

This pull request refactors the TransformDisplayClassUsage part of DelegateConstruction into a separate decompilation step. This removes an implicit dependency of TransformExpressionTrees on DelegateConstruction which will be a blocker, if we ever want to support local functions.
Previously all "display classes" were transformed by DelegateConstruction, even the ones used by expression trees.

This pull request includes:

  • a fix for #1026: Now we construct a "display class" from the fields of the state-machine type and replace all uses of ldfld/stfld stateMachineField(ldloc this, ...) with the variables introduced by the YieldReturnDecompiler.
  • a fix for #1554: Relax patterns for closure detection. Take a look at the structure of the type, not just the compiler-generated name.
  • YieldReturn and DelegateConstruction test suites now pass for mcs.

@siegfriedpammer siegfriedpammer changed the title WIP: Improved support for closures generated by Mono C# compiler Improved support for closures generated by Mono C# compiler Jul 7, 2019

@siegfriedpammer siegfriedpammer merged commit 132595a into master Jul 7, 2019

3 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
icsharpcode.ILSpy Build #5.0.0.4859-merge-preview2-pr1561 succeeded
Details

@siegfriedpammer siegfriedpammer deleted the mcs branch Jul 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.