✅ What is C# Code Lowering?
Is there a cut and dry definition of what code lowering ("yoinking") encompasses?
e.g.:
- are top level statements "lowered" into a class/function?
- are records "lowered" into class definitions?
- are properties "lowered" into methods?
Generally asking: What is code lowering in C#, where can I observe it or its effects in my code, and where can I read more about it?
Thanks in advance!
9 Replies
Sharplab can tell you what gets lowered into what
1. Website: sharplab.io
2. ILSpy from Github: https://github.com/icsharpcode/ILSpy
GitHub
GitHub - icsharpcode/ILSpy: .NET Decompiler with support for PDB ge...
.NET Decompiler with support for PDB generation, ReadyToRun, Metadata (&more) - cross-platform! - icsharpcode/ILSpy
To answer your questions, though:
* yes
* yes
* no
Thanks for the replies so far.
Can I infer then that code lowering is simply the C#->C# transformation the compiler performs before actually compiling?
Something like that, yeah
Yes, This is exactly what they do, and ILSpy can also specify the corresponding version.
The corresponding compiler version?
Language version.
Right.
Thanks guys.