The stupid, but probably not very rare mistake, when I replaced the string literal with a static string, led to something like the following piece of code, which was probably almost never intended and trivial to define even for a machine:
public partial class T { static string S = S; }
This does not cause diagnostics with VS Professional 2013, .NET Framework 4.6.0.1055, warning level 4. 1 Why not?
1 To be fair with the compiler, I assume that initialization is clearly defined and assigns the value S'in its state to default values before explicit initialization, that is, null, to itself when initialization is ultimately completed; but it is almost certainly a coding error.
source
share