© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
13 replies
Jason_Bjorn

✅ IL for function vs expression-bodied-function

Why do these two compile to different things?
class Program {
    int Double1(int n) => n + n;

    int Double2(int n) {
        return n + n;
    }
}
class Program {
    int Double1(int n) => n + n;

    int Double2(int n) {
        return n + n;
    }
}
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

✅ Delegate vs lambda function/expression
C#CC# / help
11mo ago
Expression vs Statement vs Expression statement in programming
C#CC# / help
13mo ago
Lambda expression and arrow function
C#CC# / help
2y ago
❔ IL CodeGen for toy compiler [advice]
C#CC# / help
3y ago