Closed
Description
TypeScript Version: 2.5.2
Code
@Injectable()
export class DefaultExceptionHandler extends ErrorHandler {
constructor(protected notificationService: NotificationService) {
super(false); // no rethrow of errors
}
....
}
@Injectable()
export class MyExceptionHandler extends DefaultExceptionHandler {
constructor(@Inject(dispatcher) private dispatcher: Subject<Action>, notificationService: NotificationService) {
super(notificationService);
}
....
}
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:
ERROR in [at-loader] ./src/app/common/services/my-exception-handler.service.ts:7:14
TS2417: Class static side 'typeof MyExceptionHandler' incorrectly extends base class static side 'typeof DefaultExceptionHandler'.
Types of property 'ctorParameters' are incompatible.
Type '() => ({ type: typeof Subject; decorators: { type: InjectDecorator; args: OpaqueToken[]; }[]; } |...' is not assignable to type '() => { typ
e: typeof NotificationService; }[]'.
Type '({ type: typeof Subject; decorators: { type: InjectDecorator; args: OpaqueToken[]; }[]; } | { typ...' is not assignable to type '{ type: t
ypeof NotificationService; }[]'.
Type '{ type: typeof Subject; decorators: { type: InjectDecorator; args: OpaqueToken[]; }[]; } | { type...' is not assignable to type '{ type:
typeof NotificationService; }'.
Type '{ type: typeof Subject; decorators: { type: InjectDecorator; args: OpaqueToken[]; }[]; }' is not assignable to type '{ type: typeof No
tificationService; }'.
Types of property 'type' are incompatible.
Type 'typeof Subject' is not assignable to type 'typeof NotificationService'.
Property 'ctorParameters' is missing in type 'typeof Subject'.