Skip to content

NativeAOT test infrastructure should mark indirect structures as Kept #80408

Closed

Description

@tlakollo

Description

Currently, NativeAOT behavior is to keep interface declarations when they are part of an interface list. For example

class SomeClass : IFoo<int>, IFoo<string>, IFoo<Cat>, IFoo2<int>

Would keep the interface IFoo and IFoo2
Besides keeping the interfaces, in the case of the Cat class NativeAOT will keep it as a necessary MethodTable (not allocated/constructed), which means that other things can refer to it if they have to, but wasn't seen as allocated anywhere.
The testing infrastructure does not take into consideration the MethodTable as a kept item, even though in IL terms the structure was kept

Reproduction Steps

See the TypeWithPreserveFieldsHasBackingFieldsOfPropertiesRemoved test from NativeAOT

Expected behavior

The Cat class should be marked as Kept by the testing infrastructure

Actual behavior

The Cat class is not marked as Kept by the testing infrastructure

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Activity

  1. added this to the 8.0.0 milestone on Jan 10, 2023
  2. added a commit that references this issue on Feb 8, 2023
    56aff4f
  3. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Feb 8, 2023
  4. added a commit that references this issue on Feb 10, 2023
    47a45cb
  5. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Feb 10, 2023
  6. ghost locked as resolved and limited conversation to collaborators on Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions