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

fixes for Win2D to build #140

Merged
merged 5 commits into from
Jan 23, 2024
Merged

fixes for Win2D to build #140

merged 5 commits into from
Jan 23, 2024

Conversation

stevenbrix
Copy link
Collaborator

@stevenbrix stevenbrix commented Jan 22, 2024

These fixes were required to get the Microsoft.Graphics.Canvas WinMD to build, the few things that this winmd uncovered:

  1. Simply deriving from an interface resulted in not properly tracking dependencies.
  2. subscript is a method and needs to be escaped with backticks
  3. There are static methods which technically "override" others (they have the same name, num of params and return types are related). These need to be marked as class methods and the derived types have to say override

Changes

  1. add w.add_depends in some places where we don't use any of the write(type) methods. We don't use those methods because swift name requirements for deriving from a generic interface don't follow "normal" (as in what most other languages do - where you need IFoo instead of IFoo<Bar>) naming patterns. Plus those write methods are fragile so just adding the add_depends instead of modifying the write methods to do the right thing
  2. add subscript to the list of names that need backticks
  3. this one is a bit more involved, we have to walk the class hierarchy and see if a function matches. This is similar to what we do for base_has_matching_constructor and a match is considered if the following are true:
    a. function name matches
    b. parameters match
    c. return type of derived static method is the same or derived from the return of the base class

Testing

Added test cases

@stevenbrix stevenbrix changed the base branch from steve/ibuffer-byte-access to main January 23, 2024 18:34
@stevenbrix stevenbrix marked this pull request as ready for review January 23, 2024 18:39
@stevenbrix stevenbrix requested a review from a team as a code owner January 23, 2024 18:39
@stevenbrix stevenbrix changed the title add missing dependencies fixes for Win2D to build Jan 23, 2024
Copy link

@darinf darinf left a comment

Choose a reason for hiding this comment

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

LGTM!

@stevenbrix stevenbrix merged commit 930217e into main Jan 23, 2024
1 check passed
@stevenbrix stevenbrix deleted the steve/fixes-for-win2d branch January 23, 2024 18:56
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