Basic tracking of MethodInfo and use it to improve Expression.Property and MakeGenericMethod#1880
Merged
vitek-karas merged 4 commits intodotnet:mainfrom Mar 11, 2021
Merged
Conversation
…y and MakeGenericMethod Adds the ability to track some basic patterns around `MethodBase`/`MethodInfo`. Linker now recognizes `ldtoken` for a method as well as tracks return value of `Type.GetMethod`. With this, the change implements two improvements: dotnet#1814 - Mark property as accessed via reflection when using Expression.Property(Expression,MethodInfo) Added a new warning to report cases where the intrinsic handling of the Property call doesn't work. dotnet#1727 - Ability to handle simple MakeGenericMethod calls without generating a warning If the generic method has no annotations on the generic arguments, linker will no longer warn. Added tests for all the new behaviors. Improved tests for MakeGenericMethod and MakeGenericType. Implement checking for new constraint in MakeGenericType - it now behaves the same as if the generic argument is annotated.
Member
Author
|
/cc @eerhardt |
mateoatr
reviewed
Mar 10, 2021
MichalStrehovsky
approved these changes
Mar 11, 2021
marek-safar
approved these changes
Mar 11, 2021
This was referenced Mar 11, 2021
Closed
vitek-karas
added a commit
to vitek-karas/runtime
that referenced
this pull request
Jun 16, 2021
…sors This mostly a linker test as this effectively validates linker feature from dotnet/linker#1880. But having a clean trimming tests here is better validation for this specific case.
eerhardt
pushed a commit
to dotnet/runtime
that referenced
this pull request
Jun 17, 2021
…sors (#54279) * Add a test for Expression.Property and its handling of property accessors This mostly a linker test as this effectively validates linker feature from dotnet/linker#1880. But having a clean trimming tests here is better validation for this specific case. * Add one more test case as per feedback * Remove debugging leftover
agocke
pushed a commit
to dotnet/runtime
that referenced
this pull request
Nov 16, 2022
…y and MakeGenericMethod (dotnet/linker#1880) Adds the ability to track some basic patterns around `MethodBase`/`MethodInfo`. Linker now recognizes `ldtoken` for a method as well as tracks return value of `Type.GetMethod`. With this, the change implements two improvements: dotnet/linker#1814 - Mark property as accessed via reflection when using Expression.Property(Expression,MethodInfo) Added a new warning to report cases where the intrinsic handling of the Property call doesn't work. dotnet/linker#1727 - Ability to handle simple MakeGenericMethod calls without generating a warning If the generic method has no annotations on the generic arguments, linker will no longer warn. Added tests for all the new behaviors. Improved tests for MakeGenericMethod and MakeGenericType. Implement checking for new constraint in MakeGenericType - it now behaves the same as if the generic argument is annotated. Commit migrated from dotnet/linker@9192a2d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds the ability to track some basic patterns around
MethodBase/MethodInfo. Linker now recognizesldtokenfor a method as well as tracks return value ofType.GetMethod.With this, the change implements two improvements:
#1814 - Mark property as accessed via reflection when using Expression.Property(Expression,MethodInfo)
Added a new warning to report cases where the intrinsic handling of the Property call doesn't work.
#1727 - Ability to handle simple MakeGenericMethod calls without generating a warning
If the generic method has no annotations on the generic arguments, linker will no longer warn.
Added tests for all the new behaviors.
Improved tests for MakeGenericMethod and MakeGenericType.
Implement checking for new constraint in MakeGenericType - it now behaves the same as if the generic argument is annotated.