This transformation checks for various issues in a TranslatedLibrary
which might prevent it the generated C# from being emitted or compiled successfully.
It checks a multitude of things. For some things it will fix the issue and emit a warning, for other issues with no objective simple fix it will emit an error.
Ideally you should try to fix issues it finds with a transformation. Any changes this verification transformation makes are considered last resort and are simply to cut down on the number of things the output generation stage needs to worry about.
This transformation represents the verification stage and is basically always required. Do not skip this transformation unless you're really sure you don't need it.
The output generation stage generally assumes this stage has been run. It performs only the most basic of sanity checks that the input TranslatedLibrary
is valid, and generally does not attempt to behave in a sane manner in situations where verification should've failed. (This is done to keep the output generation stage relatively simple.)
This transformation should be the final transformation run in your pipeline, and be followed by a final execution of BrokenDeclarationExtractor
to remove any declarations it deemed invalid.
You should not rely on the fixes applied by this transformation. If you prefer the way it handles certain things (such as converting protected
to internal
) then you should make your own translation to replicate that behavior rather than ignoring the warnings it produces. (The primary reason for this is that this implementation of this phase may change if something previously invalid becomes valid or valid in some situations. For example, we might change the behavior of protected
's use when #105 is implemented.)
If you receive warnings or errors from this translation (especially after an upgrade), you should check if there's any built-in translations which you aren't running.