-
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
Generic attributes lack testing #73735
Comments
Tagging subscribers to this area: @dotnet/area-system-reflection Issue DetailsWe need reflection tests that test generic attributes. dotnet/linker#2963 made it clear that we don't have any targeted reflection tests for the new scenario in the libraries partition. The newly added test is not a targeted reflection test - it's a S.R.Metadata test.
|
We have some tests, but might need to improve the coverage |
The specific tests that are needed are tests that are using the generic type's T in the signatures (that's the bug we ran into). So things like: class FooAttribute<T>: Attribute { public FooAttribute(T value, T[] othervalue) { } }
class BarAttribute<T> : Attribute { public T SomeValue { get; set; } } The existing tests are not testing much because they don't use the T. |
I would definitely at least put it in 8.0 but AFAIK generic attributes are new in C# for .NET 7.0 so we should have testing in place to make sure reflection on them actually works in various scenarios. Cc @333fred |
Sure, we will reevaluate all issue during 8.0 planning |
That's correct. |
Moving to 9; the mono bug linked above unfortunately didn't add a test that would have helped here. |
- Added a test for GetCustomAttribute to verify that the values of the generic type are correctly initialized. - Added some theory data to check the equality of generic attributes. Fixes dotnet#73735
* Added additional tests for generic attributes. - Added a test for GetCustomAttribute to verify that the values of the generic type are correctly initialized. - Added some theory data to check the equality of generic attributes. Fixes dotnet#73735 * Removed active issue attribute for solved issue 56887. * Added active issue attribute for solved issue dotnet#56887 because the test is still failing on Mono. * Update src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Attributes.cs --------- Co-authored-by: Stefan König <[email protected]> Co-authored-by: Buyaa Namnan <[email protected]>
We need reflection tests that test generic attributes.
dotnet/linker#2963 made it clear that we don't have any targeted reflection tests for the new scenario in the libraries partition. The newly added test is not a targeted reflection test - it's a S.R.Metadata test.
The text was updated successfully, but these errors were encountered: