Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Added Associated Type support in Get properties #314

Merged
merged 3 commits into from
Feb 14, 2020
Merged

Conversation

stephen-hawley
Copy link
Contributor

Added Associated Types support in get properties.

This is only a smoke test - the code doesn't get executed (yet).

For the most part, the work was similar to methods:

  • flag when a protocol has associated types
  • use the correct method in the static receiver
  • use the generic renamer to get the associated type names in the generics

One other things that came up - the way that I handle the wrapper for associated types is that I write a synthetic ClassDeclaration and copy all the protocol methods and properties into it. That done, it can get passed to MethodWrapping to get turned into a set of functions that we can pinvoke into.
The problem I was having was that every member of the class points to the parent, but when I was looking for the a matching wrapper, I wasn't finding it, and sure enough, the wrapper class didn't have any properties in it.
The problem was that when I called MakeUnrooted on the synthetic class, its members lost their parentage. I put in a hack patch instead of fixing MakeUnrooted because I'm worried about code that might depend on that behavior. Issue for that is here.

getBlock = ifblock;
if (getBlock.Count == 0)
getBlock = ifblock;
else {
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: if one part of the if statement has curly braces, the other should have too (or neither).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good to know. Likely this test is going to go away in about 4 PRs so I'm not going to fix it now.

@stephen-hawley stephen-hawley merged commit 3205777 into master Feb 14, 2020
@stephen-hawley stephen-hawley deleted the pat-prop branch February 14, 2020 19:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants