C
C#5mo ago
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;
}
}
10 Replies
reflectronic
reflectronic5mo ago
they do not in release mode
Jason_Bjorn
Jason_BjornOP5mo ago
Oh, you're right interesting
reflectronic
reflectronic5mo ago
in debug mode they are different so that you can set a breakpoint/step onto on the braces
Jason_Bjorn
Jason_BjornOP5mo ago
Appreciate it @reflectronic !close
reflectronic
reflectronic5mo ago
$close
MODiX
MODiX5mo ago
If you have no further questions, please use /close to mark the forum thread as answered
Jason_Bjorn
Jason_BjornOP5mo ago
No description
Jason_Bjorn
Jason_BjornOP5mo ago
something's broken
reflectronic
reflectronic5mo ago
hm seems unfortunate
Servator
Servator5mo ago
You could try
/close
/close
Want results from more Discord servers?
Add your server