Skip to content

Generic attributes lack testing #73735

Closed

Description

@MichalStrehovsky

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.

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Aug 10, 2022
  2. buyaa-n commented on Aug 11, 2022

    @buyaa-n
    Contributor

    We have some tests, but might need to improve the coverage

  3. added this to the Future milestone on Aug 11, 2022
  4. ghost removed
    untriagedNew issue has not been triaged by the area owner
    on Aug 11, 2022
  5. MichalStrehovsky commented on Aug 12, 2022

    @MichalStrehovsky
    MemberAuthor

    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.

  6. MichalStrehovsky commented on Aug 12, 2022

    @MichalStrehovsky
    MemberAuthor

    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

  7. buyaa-n commented on Aug 12, 2022

    @buyaa-n
    Contributor

    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.

    Sure, we will reevaluate all issue during 8.0 planning

  8. 333fred commented on Aug 12, 2022

    @333fred
    Member

    AFAIK generic attributes are new in C# for .NET 7.0

    That's correct.

  9. modified the milestones: Future, 8.0.0 on Nov 7, 2022
  10. steveharter commented on Jul 24, 2023

    @steveharter
    Contributor

    Moving to 9; the mono bug linked above unfortunately didn't add a test that would have helped here.

  11. modified the milestones: 8.0.0, 9.0.0 on Jul 24, 2023
  12. modified the milestones: 9.0.0, 10.0.0 on Jul 24, 2024
  13. added a commit that references this issue on Aug 21, 2024
    c29b7e0
  14. added
    in-prThere is an active PR which will close this issue when it is merged
    on Aug 21, 2024
  15. added a commit that references this issue on Aug 29, 2024
    92d0ed4
  16. added a commit that references this issue on Sep 17, 2024
    42b55e9
  17. locked and limited conversation to collaborators on Oct 2, 2024
  18. added a commit that references this issue on Dec 10, 2024
    4f43414
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Reflectionhelp wanted[up-for-grabs] Good issue for external contributorsin-prThere is an active PR which will close this issue when it is mergedtest-enhancementImprovements of test source code

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions