Skip to content

NativeAOT xml support has to be able to understand cecil format for types #73083

Closed

Description

@tlakollo

Description

Other members rely on the CecilTypeNameFormatter to obtain the Cecil representation of a member. For example, we will pass the name of the Cecil member and a TypeDesc and we will get back the Internal.TypeSystem representation.
In the case of type processing, we have a ModuleDesc and we will attempt to find the type name inside of it. For this purpose, we use the CustomAttributeTypeNameParser.GetTypeByCustomAttributeTypeName() which basically attempts to try to get a TypeDesc out of the ModuleDesc by name, what it doesn't account for is that the name is Cecil formatted causing mismatches for nested types and generics. Need to implement a different CustomAttributeTypeNameParser that also converts from Cecil format to Internal.TypeSystem one.
For now, there is a change that replaces the Cecil nested type separator character ("/") for the Internal.TypeSystem nested type separator character ("+") to enable basic functionality.

Reproduction Steps

Add an xml that has a nested type or generic using cecil format

<linker>
  <type fullname="Program/NestedTypeKeptViaDescriptor"/>
</linker>

Expected behavior

The xml should process the type and its members

Actual behavior

The xml doesnt understand how to resolve the type and ends up throwing

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Activity

  1. ghost added
    untriaged
    on Jul 29, 2022
  2. added this to the 7.0.0 milestone on Jul 29, 2022
  3. ghost removed
    untriaged
    on Jul 29, 2022
  4. modified the milestones: 7.0.0, 8.0.0 on Aug 12, 2022
  5. moved this to High Priority in AppModelon Aug 12, 2022
  6. tlakollo commented on Feb 21, 2023

    @tlakollo
    ContributorAuthor

    Closed via #82145

  7. ghost locked as resolved and limited conversation to collaborators on Mar 24, 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

    • Status
      High Priority

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions