C
C#7mo 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
reflectronic7mo ago
they do not in release mode
Jason_Bjorn
Jason_BjornOP7mo ago
Oh, you're right interesting
reflectronic
reflectronic7mo ago
in debug mode they are different so that you can set a breakpoint/step onto on the braces
Jason_Bjorn
Jason_BjornOP7mo ago
Appreciate it @reflectronic !close
reflectronic
reflectronic7mo ago
$close
MODiX
MODiX7mo ago
If you have no further questions, please use /close to mark the forum thread as answered
Jason_Bjorn
Jason_BjornOP7mo ago
No description
Jason_Bjorn
Jason_BjornOP7mo ago
something's broken
reflectronic
reflectronic7mo ago
hm seems unfortunate
Servator
Servator7mo ago
You could try
/close
/close

Did you find this page helpful?