angulardart-community / angular

Fast and productive web framework provided by Dart.
https://pub.dev/packages/ngdart
MIT License
114 stars 14 forks source link

fix: mixins are not ClassElement #38

Closed genesistms closed 1 year ago

genesistms commented 1 year ago

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 commented 1 year ago

@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.

genesistms commented 1 year ago

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