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

Handle type params with defaults when deriving properties #1408

Merged
merged 1 commit into from
Jul 12, 2020

Conversation

siku2
Copy link
Member

@siku2 siku2 commented Jul 11, 2020

Description

yew-macro generates invalid code when deriving properties for generic types where one of the type parameters has a default value. See the linked issue for further details.

This PR changes the code generation so that it no longer naively pushes type parameters to the end of the list. Instead, they're now added before the first type parameter with a default value.

Fixes #1405

Checklist:

  • I have run ./ci/run_stable_checks.sh
  • I have reviewed my own code
  • I have added tests

@jstarry
Copy link
Member

jstarry commented Jul 12, 2020

Looks fantastic, thanks @siku2 for the fix!

@jstarry jstarry merged commit f7ce3e2 into yewstack:master Jul 12, 2020
@siku2 siku2 deleted the fix-1405 branch July 14, 2020 12:29
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.

"error: type parameters with a default must be trailing" when deriving Properties
2 participants