Skip to content
Discussion options

You must be logged in to vote

I would like to propose that the C# compiler be allowed to rearrange independent, side-effect free statements so that execution is deferred whenever possible.

The C# compiler is already allowed to do anything that has no observable effects other than its effect on performance. That would include rearranging independent, side-effect free statements so that execution is deferred whenever possible.

Unfortunately proving that statements are independent and side-effect free is almost impossible in C#, for all but the most trivial of cases.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by YairHalberstadt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2663 on November 01, 2020 11:17.