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

Add support for Unbound Generic Types #158

Merged
merged 11 commits into from
Aug 19, 2020
Merged

Add support for Unbound Generic Types #158

merged 11 commits into from
Aug 19, 2020

Conversation

worldbeater
Copy link
Contributor

What kind of change does this PR introduce?

This PR adds support for .Events() extension methods generation for types like AvaloniaDictionary<TKey, TValue>.

What is the current behavior?

Currently, we generate code like AvaloniaDictionary<global::TKey, global::TValue> which apparently isn't a valid C# code, stumbled upon this when attempted to use Pharmacist in AvaloniaUI projects: https://github.com/reactiveui/Pharmacist/blob/main/src/Pharmacist.Tests/IntegrationTests/Approved/Avalonia.0.8.4.netstandard2.0.approved.txt#L284

What is the new behavior?

Now, the behavior described above is fixed, at least for that AvaloniaDictionary type. Now we use AvaloniaDictionary<TKey, TValue> as a private readonly field, and pass the generic type parameters to the generated RxAvaloniaDictionaryEvents<TKey, TValue> class. Also, we pass the parameters to the generated .Events() method, and now its signature looks like .Events<TKey, TValue>(). Also, there was an issue with "Rx" + name + "Events" classes that inherit from unbound generic types, and that should also be fixed now.

What might this PR break?

Hopefully nothing. Let's wait for a report from the CI?

@worldbeater worldbeater added the bug Something isn't working label Aug 19, 2020
@worldbeater
Copy link
Contributor Author

worldbeater commented Aug 19, 2020

Whoops, messed up with formatting in a few places. Fixing this now.

@worldbeater worldbeater marked this pull request as ready for review August 19, 2020 12:25
@worldbeater worldbeater requested review from a team and glennawatson August 19, 2020 12:25
@glennawatson glennawatson merged commit 3e64ef6 into main Aug 19, 2020
@glennawatson glennawatson deleted the avalonia-platform branch August 19, 2020 14:05
@reactiveui reactiveui locked as resolved and limited conversation to collaborators Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants