I saw a library code variable named like this
private readonly Encoder <Encoder>k__BackingField;
I tried to name it in Visual Studio 2022 but it didn't work
Can c# name add angle brackets? Which version of grammar is it?
I saw a library code variable named like this
private readonly Encoder <Encoder>k__BackingField;
I tried to name it in Visual Studio 2022 but it didn't work
Can c# name add angle brackets? Which version of grammar is it?
The angle brackets (< and >) are used for generic type parameters, and they are not allowed in variable names.
Examples that work are:
private readonly Encoder<T> tEncoder;
private readonly Encoder<string> stringEncoder;
...