Skip to content
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

fix unwrapping types from the abi #107

Merged
merged 5 commits into from
Oct 25, 2023
Merged

Conversation

stevenbrix
Copy link
Collaborator

@stevenbrix stevenbrix commented Oct 23, 2023

unwrapping classes from the ABI was tied to unsealed classes only. this was done as a way to create the proper derived type from an API which returns a base type.

support was added to unwrap interfaces through MakeFromAbi, this expands that to support all classes

Changes

  1. Modify MakeFromAbi to be a method implemented on the module. there are too many exports otherwise.
  2. Add methods to create types and interfaces from the abi
  3. deleted duplicate testAggregation method

Testing

Updated my local build of Arc and was able to remove some workarounds we have

Fixes WIN-794

@linear
Copy link

linear bot commented Oct 23, 2023

WIN-794 creating a sealed class from an API which returns a base type doesn't work

example:

AppWindow.Presenter property returns a AppWindowPresenter type and the default value is an OverlappedPresenter but since OverlappedPresenter is a sealed class we don't create makeFromAbi implementation for it and you aren't able to cast

@stevenbrix stevenbrix marked this pull request as ready for review October 23, 2023 18:17
@stevenbrix stevenbrix requested a review from a team as a code owner October 23, 2023 18:17
Copy link
Contributor

@tristanlabelle tristanlabelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I made enough sense of it to sign off!

swiftwinrt/code_writers.h Outdated Show resolved Hide resolved
@stevenbrix stevenbrix force-pushed the steve/fix-unwrap-from-abi branch from b1abf4e to f869a40 Compare October 25, 2023 20:45
@stevenbrix stevenbrix merged commit 58c2018 into main Oct 25, 2023
1 check passed
@stevenbrix stevenbrix deleted the steve/fix-unwrap-from-abi branch October 25, 2023 20:52
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.

2 participants