This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Repository navigation
Simplify unknown binding flags handling and fix param names - #2426
Merged
vitek-karas merged 2 commits intoDec 9, 2021
Merged
vitek-karas merged 2 commits into
vitek-karas merged 2 commits into
Conversation
The helpers to tanslate binding flags to annotation already handle unsupported/unknown binding flags, so there's no need for the intrinsics to handle that yet again. Just simplifies the code. Also fixed places where we lookup method parameters. If the lookup is done on a MethodReference the parameters typically don't have names. So instead do it on the MethodDefinition where they do have names and thus produce much better diagnostic messages.
tlakollo
reviewed
Dec 8, 2021
Comment on lines
+1089
to
+1093
| // Otherwise fall back to the bitfield requirements | ||
| var requiredMemberTypes = GetDynamicallyAccessedMemberTypesFromBindingFlagsForConstructors (bindingFlags); | ||
| // We can scope down the public constructors requirement if we know the number of parameters is 0 | ||
| if (requiredMemberTypes == DynamicallyAccessedMemberTypes.PublicConstructors && ctorParameterCount == 0) | ||
| requiredMemberTypes = DynamicallyAccessedMemberTypes.PublicParameterlessConstructor; |
Contributor
There was a problem hiding this comment.
We calculate always the requiredMemberTypes but, for most operations, we end up not using it and we just use the binding flags. I don't see the advantage of having it up here.
agocke
pushed a commit
to dotnet/runtime
that referenced
this pull request
Nov 16, 2022
…inker#2426) The helpers to tanslate binding flags to annotation already handle unsupported/unknown binding flags, so there's no need for the intrinsics to handle that yet again. Just simplifies the code. Also fixed places where we lookup method parameters. If the lookup is done on a MethodReference the parameters typically don't have names. So instead do it on the MethodDefinition where they do have names and thus produce much better diagnostic messages. Commit migrated from dotnet/linker@5919fd8
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The helpers to translate binding flags to annotation already handle unsupported/unknown binding flags, so there's no need for the intrinsics to handle that yet again. Just simplifies the code.
Also fixed places where we lookup method parameters. If the lookup is done on a MethodReference the parameters typically don't have names. So instead do it on the MethodDefinition where they do have names and thus produce much better diagnostic messages.