I saw this strange behavior, and I wonder if there is a reasonable explanation for this:
When I (accidentally) added an extra / additional semicolon to a local variable of a function, for example:
public void MyMethod () { int a = 1;; Console.WriteLine(a);
It compiles, but shows that it is superfluous.

But when I did this with fields (also by accident), I got an error (compilation):

Question
Is there a reason for this limitation in the fields?
Nb I already know another limitation thing, not to allow var with fields. But here it is something else.
c # compiler-errors
Royi Namir Dec 22 '14 at 11:28 2014-12-22 11:28
source share