Well i tried something else
I told myself this should raise an exception as i'm putting 54 in i while i is not declared/initalized.Code:Console.WriteLine("a"); goto test; int i; i = 23; test: i = 54; Console.WriteLine(i.ToString()); Console.ReadKey(true);
And what happens is that my console actually prints 54 !
I decompiled the IL (with ILSpy) and found that :
How the compiler figured out that ? I didn't compiled in relase, i was in debug. Could someone explains me to what extent the compiler actually interprets the code ?Code:Console.WriteLine("a"); Console.WriteLine(54.ToString()); Console.ReadKey(true);




Reply With Quote