Cysharp / ConsoleAppFramework

Zero Dependency, Zero Overhead, Zero Reflection, Zero Allocation, AOT Safe CLI Framework powered by C# Source Generator.
MIT License
1.54k stars 88 forks source link

Ignore attribute #128

Closed BlackPhlox closed 2 weeks ago

BlackPhlox commented 2 weeks ago

Allows for classes that have commands to inherit from an abstract class with abstract and or virtual methods, as private methods cannot be abstract or virtual, see CS0621

When dogfooding for creating a CLI, I needed this and I couldn't think of another way to do this without the compiler complaining.

See the new test and its comment for a visual explanation.

neuecc commented 2 weeks ago

In this example, it seems like it should just be protected. Is that not good enough?

BlackPhlox commented 2 weeks ago

Huh, I don't know why I didn't think of that. In that case, I can't think of a use case currently where the ignore attribute would be useful, other than the class having methods that may only be called programmatically or during reflection.

neuecc commented 2 weeks ago

OK, I'll close this PR. If you have solved the problem, good.