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

Filter mixins that have different types #1510

Merged
merged 3 commits into from May 8, 2024
Merged

Conversation

daddykotex
Copy link
Contributor

@daddykotex daddykotex commented May 5, 2024

Similar to what was done in #425, I've filtered out the
mixins that have different type than the final shape they're
applied to.

As such, in the example above, HasName has a optional name
member where as Person inherits the mixin but makes the member
required. The filtering catches that and as a result the mixin is
removed from the list of mixins to add on Person.

This behaviour aligns with the behaviour that happens when no @adt
trait is added and Person is code generated on it's own. In both
cases, now, the trait HasName is not extended because the types of
name don't align.

PR Checklist (not all items are relevant to all PRs)

  • Added unit-tests (for runtime code)
  • Added bootstrapped code + smoke tests (when the rendering logic is modified)
  • Added build-plugins integration tests (when reflection loading is required at codegen-time)
  • Added alloy compliance tests (when simpleRestJson protocol behaviour is expanded/updated)
  • Updated dynamic module to match generated-code behaviour
  • Added documentation
  • Updated changelog

Similar to what was done in #425, I've filtered out the
mixins that have different type than the final shape they're
applied to.

As such, in the example above, `HasName` has a optional name
member where as `Person` inherits the mixin but makes the member
required. The filtering catches that and as a result the mixin is
removed from the list of mixins to add on `Person`.

This behaviour aligns with the behaviour that happens when no `@adt`
trait is added and `Person` is code generated on it's own. In both
cases, now, the trait `HasName` is not extended because the types of
`name` don't align.
@daddykotex daddykotex changed the title Dfrancoeur/1457 Filter mixins that have different types May 6, 2024
@Baccata
Copy link
Contributor

Baccata commented May 6, 2024

@daddykotex thanks for this. Please sync the PR and I'll get it merged

@Baccata Baccata merged commit 5480e8e into series/0.18 May 8, 2024
11 checks passed
@Baccata Baccata deleted the dfrancoeur/1457 branch May 8, 2024 09:47
@kubukoz
Copy link
Member

kubukoz commented May 9, 2024

This closes #1457, right? @daddykotex

@daddykotex
Copy link
Contributor Author

Yup my bad.

@kubukoz
Copy link
Member

kubukoz commented May 9, 2024

No problem at all! Thanks for the fix :)

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.

None yet

3 participants