Enhance assembly name reference and system type resolution #929

Open
denis-kudelin wants to merge 1 commit from denis-kudelin/transitive-dependency-fix into master
denis-kudelin commented 2023-11-12 00:58:09 -06:00 (Migrated from github.com)

This commit refines the system type import functionality in Mono.Cecil to ensure that system types are resolved efficiently and do not introduce unnecessary assembly references. By aligning the import logic with the assembly containing the built-in System.Object type, the mechanism now avoids importing types from system assemblies that the running assembly already references.

Key changes you'll find in this commit:

  • The TryGetAssemblyNameReference method has been updated to prevent importing system types from outside the core system assembly (e.g., mscorlib or System.Private.CoreLib) if a type belongs to the same assembly as System.Object.
  • The TryGetAssemblyNameReference method has been improved to handle both direct and forwarded assembly references with greater precision.

These changes contribute to a leaner import process, eliminating redundant assembly references and adhering to the common developer expectations regarding system type resolution in .NET environments.

This commit refines the system type import functionality in Mono.Cecil to ensure that system types are resolved efficiently and do not introduce unnecessary assembly references. By aligning the import logic with the assembly containing the built-in `System.Object` type, the mechanism now avoids importing types from system assemblies that the running assembly already references. Key changes you'll find in this commit: - The TryGetAssemblyNameReference method has been updated to prevent importing system types from outside the core system assembly (e.g., mscorlib or System.Private.CoreLib) if a type belongs to the same assembly as `System.Object`. - The TryGetAssemblyNameReference method has been improved to handle both direct and forwarded assembly references with greater precision. These changes contribute to a leaner import process, eliminating redundant assembly references and adhering to the common developer expectations regarding system type resolution in .NET environments.
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'denis-kudelin/transitive-dependency-fix:denis-kudelin/transitive-dependency-fix'
git switch 'denis-kudelin/transitive-dependency-fix'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'master'
git merge --no-ff 'denis-kudelin/transitive-dependency-fix'
git switch 'denis-kudelin/transitive-dependency-fix'
git rebase 'master'
git switch 'master'
git merge --ff-only 'denis-kudelin/transitive-dependency-fix'
git switch 'denis-kudelin/transitive-dependency-fix'
git rebase 'master'
git switch 'master'
git merge --no-ff 'denis-kudelin/transitive-dependency-fix'
git switch 'master'
git merge --squash 'denis-kudelin/transitive-dependency-fix'
git switch 'master'
git merge --ff-only 'denis-kudelin/transitive-dependency-fix'
git switch 'master'
git merge 'denis-kudelin/transitive-dependency-fix'
git push origin 'master'
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-jbevain/cecil!929
No description provided.