I was writing this piece of code:
public const int MAJOR_VERSION = 3;
public const int MINOR_VERSION = 3;
public const string VERSION_STRING = $"v.{MAJOR_VERSION}{MINOR_VERSION}";
And, maybe not surprisingly, the compiler was complaining:
"The expression being assigned to VERSION_STRING must be constant"
I understand that const expressions are meant to be propagated by the compiler, but in this particular case, the string can very easily be statically created because it depends only on other constants.
So perhaps someone can explain to me why this is not already a feature of the language? Or maybe even, why it's silly of me to ask such a question..
Thanks in advance. :)