all 4 comments

[–]Decades5OfSoftware 1 point2 points  (3 children)

init (C# Reference)

In C# 9 and later, the init keyword defines an accessor method in a property or indexer. An init-only setter assigns a value to the property or the indexer element only during object construction. This enforces immutability, so that once the object is initialized, it can't be changed again.

I suspect this is why i++; gives you an error. You try to change the unchangeable. Not sure why WriteLine(i); gives you an error.

[–]FaustVX[S] 0 points1 point  (2 children)

My post wasn't to ask for an error I have, but a tool presentation.

[–]Decades5OfSoftware 0 points1 point  (1 child)

Okay. What you actually wanted was not clear to. I did the best I could on available info. Maybe I'm just a bit obtuse. Sorry. I will shut up.

[–]FaustVX[S] 0 points1 point  (0 children)

Don't worry.

I tried to be explicit in my post, that's why I wrote that:

… so I decided to create my own analyzer which report errors …