-
Notifications
You must be signed in to change notification settings - Fork 12.8k
TSC2417 - Incorrectly extending other class (which is not the case) #18643
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
The error talks about a static property |
I found the issue. The problem is the AoT compiler of angular which will generate these static ctorParameters during his compilation cycle. The typescript compiler will start his work afterwards and then breaks with the exception above. The only solution for this would be if typescript provides a possibility to ignore the check for statically variables, the AoT compiler of angular changes his behavior (i assume both of this changes will not happen) or if you want to derive from another angular service you use the decorator pattern instead of inheritance. |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
TypeScript Version: 2.6.2 Code class SpecialClassName {
public static breakout(): string {
return '';
};
};
class ExtendSpecialClassName extends SpecialClassName {
public static breakout(title: string): string {
return title;
};
};
let title: string = ExtendSpecialClassName.breakout('Hi there');
console.log(name); Expected behavior:
(Actually the same as @rdnscr mentioned before; now with a working example) Actual behavior:
|
@SinoBoeckmann please see #4628 |
TypeScript Version: 2.5.2
Code
Expected behavior:
This should work since it is inheritance as it is intended. It shoud be possible to have different constructor parameters to the class i extend from.
This example was working with Typescript 2.4.2 and with TypeScript 2.5.2 it is broken.
Actual behavior:
The text was updated successfully, but these errors were encountered: