-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PersistedAssemblyBuilder missing methods on generated types #109320
Conversation
Note regarding the
|
1 similar comment
Note regarding the
|
Tagging subscribers to this area: @dotnet/area-system-reflection-emit |
@dotnet-policy-service agree |
} | ||
|
||
return candidates; | ||
} | ||
|
||
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes)] | ||
public override Type[] GetNestedTypes(BindingFlags bindingAttr) => throw new NotSupportedException(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is nested type data available somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like it is available by going through the module. Should be easy. Will try to add that one too tomorrow. I'm not sure of all the different options of mapping between BindingFlags and the attribute enum used to create types so I will create a base version and we can augment it after
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, should be good now if you want to have a look
Added GetMember and GetMembers too. It made me realize that there was some bugs related to parent members not being returned by GetMethods, GetFields, etc... By default unless |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; thanks for the contribution.
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] | ||
public override MethodInfo[] GetMethods(BindingFlags bindingAttr) | ||
{ | ||
ThrowIfNotCreated(); | ||
|
||
List<MethodInfo> methods = new(); | ||
List<MethodInfo> methods = new List<MethodInfo>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: unnecessary change here; using new()
is fine.
#108733
Add missing methods to PersistedAssemblyBuilder generated types:
Edit:
Also provide bugfixes to GetMethods, GetFields, GetProperties, GetInterfaces not returning parent members