Skip to content

Add WinRTRuntimeClassName attribute for use in scenarios where we previously used interface name - #1573

Merged
Manodasan Wignarajah (manodasanW) merged 10 commits into
staging/AOTfrom
manodasanw/generated-runtime-class-name
Apr 19, 2024
Merged

Manodasan Wignarajah (manodasanW) merged 10 commits into
staging/AOTfrom
manodasanw/generated-runtime-class-name

Conversation

@manodasanW

Copy link
Copy Markdown
Member

In scenarios where we have a type that isn't a WinRT type, but implements WinRT interfaces, we previously went through the interfaces and determined the most derived one to return as the runtime class name. This is not trim friendly. With these changes, we will do this in the AOT source generator rather than at runtime and instead at runtime lookup the attribute on the type. This also allows the opportunity for someone in this scenario to specify their own class name if desired as today if there are multiple interfaces that don't inherit from each other, we will need to choose one and that might not be what is desired by the author.

In addition to the scenarios where we put the attribute on the type, there are a couple scenarios where the type isn't authored in the component but rather a system type. To handle these scenarios, we use the lookup table similar to what we do in the CCW vtable scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants