Biohazrd
Biohazrd copied to clipboard
Enforce protected member access
C# structs do not support inheritance and by extension do not support protected
. Right now we emit protected
as private
, but usually the generator ends up changing protected
to public
anyway.
Ideally we'd like a way for protected
to be enforced as expected. One way to do this would be to have multiple "views" of a struct (one for protected and one for public) and you cast pointers when you know you should have protected access.
The other alternative is to let things be public but use a Roslyn analyzer to enforce proper protected access. The downside to this approach is protected members would clog up Intellisense.
Semi-related: We also need to enable access to protected inline constructors and methods. They can't be exported using InlineExportHelper
. https://github.com/InfectedLibraries/Biohazrd/issues/14 is somewhat related as it will likely be solved in a similar way.