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

fix: mixins are not ClassElement #38

Merged
merged 2 commits into from
Feb 12, 2023

Conversation

genesistms
Copy link

This PR solves the issue but i am not sure if this is correct approach. I would like to add tests if someone could point me where would be the best place.

I will mention @ykmnkmi as this is mostly his work.

When compiling this:

@Directive(selector: 'dir')
class MyDir with MyMixin {}

mixin MyMixin {}

you get this error:

type 'MixinElementImpl' is not a subtype of type 'ClassElement' in type cast.

This PR solves the issue but i am not sure if this is correct approach.
I would like to add tests if someone could point me where would be the
best place.

I will mention @ykmnkmi as this is mostly his work.

When compiling this:

```
@directive(selector: 'dir')
class MyDir with MyMixin {}

mixin MyMixin {}
```

you get this error:
```
type 'MixinElementImpl' is not a subtype of type 'ClassElement' in type cast.
```
@GZGavinZhao
Copy link

@genesistms You can add the tests in the file _tests/test/compiler_integration/invalid_component_test.dart using the compilesNormally helper function, like this line.

@GZGavinZhao GZGavinZhao self-requested a review February 12, 2023 13:30
@GZGavinZhao GZGavinZhao added the bug Something isn't working label Feb 12, 2023
@genesistms
Copy link
Author

Ok i added a one simple test for this use case. After resolving this issue i will try to add more similar to this.

Copy link

@GZGavinZhao GZGavinZhao left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks! I'll merge this after the CI passes.

@GZGavinZhao GZGavinZhao merged commit c9a875e into angulardart-community:master Feb 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants