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 4 commits into from Jul 7, 2019


None yet
1 participant
Copy link

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
continuous-integration/appveyor/pr AppVeyor build succeeded
icsharpcode.ILSpy Build # succeeded

@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.