Relax Validation on Final Nested Type Ordering #625
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ECMA-335 II.2 states TypeDefs should be sorted based on nested class relationships. That is, every enclosing class should be defined before its nested types in the TypeDef table. However, from empirical testing, CLR, CoreCLR and Mono do not actually implement checks for this, allowing for nested classes to be defined before their enclosing types.
This PR relaxes the NestedClass validation in AsmResolver to a non-fatal exception that can be ignored at rebuild time, to allow for typedef tokens to be preserved even if that results in nested classes being ordered incorrectly according to spec.
This PR also ensures the
<Module>
type is always assigned a RID of1
when creating a new module.Closes #545