-
Notifications
You must be signed in to change notification settings - Fork 433
Inheriting from an abstract class causes decorators of subclasses to mix #444
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
Comments
A fix for this at #445 is awaiting review. |
Some trivial, historical FYI: A problem similar to this was fixed by Pull Request #200 , but that fix doesn't work in this case, because the new code in that pull request will not even execute for the super class, because the super class doesn't have any |
Every superclass must be decorated by It is already solved in version 8. |
How sad. I guess I can't use abstract superclasses right now, then. Thanks for the quick response, anyway! Anyways, how is it looking for Version 8 and Vue 3? Will it be more-popular/best-practice to use Vue 3 with vue-class-component, as opposed to using Vue 3 without use vue-class-component ? Will most Vue 3 examples, documentation, and lessons be shown using vue-class-component (via using the kaorun343/vue-property-decorator package)? |
If abstract class
AbstractBase
extendsVue
and classA
extendsAbstractBase
and classB
also extendsAbstractBase
, then classB
will receive the decorators from classA
, which is super bad and confusing.The reason why this is an issue for abstract super classes (as opposed to not-abstract) is because TypeScript doesn't let you put a
@Component
decorator on abstract classes. So, whether the super class is abstract or not doesn't really matter, it just matters that there will not be a@Component
decorator on that super class, which situation will cause this bug.See the following test case
That test will fail on the second to last line (
td.verify(spyC(), { times: 1 });
) with the error:The text was updated successfully, but these errors were encountered: