Please note that I'm not asking about the difference between const, readonly and static. I assumed that it was clear from the contents of the question but apparently I didn't succeed to make that clear enough.
I'm aware that when declaring a constant using the keyword const, I have to specify a value at compile time and that the value needs to be, well..., constant.
The following sample works but I found that a bit lengthy and unnecessarily relaxed, so I attempted to declare the field as constant. According to my estimation, we do have a constant specification of the contents and those are never changing.
static readonly List<int> Codes = new List<int> { 1337 };
Evidently, according to the computer it's not and the nit-picker won't compile the following example. That contradicts my expectations and I'm not clear on how the computer figures. Hence the question - why doesn't it like it?
const List<int> Codes = new List<int> { 1337 };
The exact formulation is, as one'd expect: Constant initializer must be compile-time constant but that answers why the error. It doesn't really explains where's the non-constant part.