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