-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Missing test coverage for CustomConstantAttribute #49748
Comments
Hey, I'd love to work with the issue. If you don't mind I will take it. |
It's yours! Thank you! |
There is a test the custom constant attribute assigns the default value to Type.Missing parameter.
@MichalStrehovsky @SkiFoD seems it is fixed with #49767? Could we close it? |
Yup, closing. |
Hello @MichalStrehovsky I know this is an closed issue but is related to what I am trying to fix for Mono via #75612 . Based on this comment: https://github.com/dotnet/runtime/blob/79ae74f5ca5c8a6fe3a48935e85bd7374959c570/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeParameterInfo.cs#L311-#L317 and code that follows, it seems coreCLR would handle default value resolution differently when there are more than one Do you have any insight on what would be the desired behaviour? PS I am also planning to improve test coverage for such cases. |
The defined behavior is basically how CoreCLR implemented it because it has been like that for 20 years. It also looks like there's a difference in behavior for DefaultValue and RawDefaultValue (one seems to pick the first CustomConstant, the other will pick the last one). Fun. Thanks for looking into it! |
This is used in e.g. reflection invoke and Delegate.DynamicInvoke. The below program will print "Hello". We should ideally turn this into a test and add it somewhere around
runtime/src/libraries/System.Runtime/tests/System/DelegateTests.cs
Line 106 in 79ae74f
The text was updated successfully, but these errors were encountered: