I work with the following Typescript classes:
I have an abstract class
export abstract class MyAbstractClass { ..... }Class A which implements the methods of the abstract class
export ClassA extends MyAbstractClass { readonly MY_FIRST_CONTS = 'blaa'; readonly MY_SECOND_CONTS = 'blaablaaa'; .... }class B which extends class A and I want to override the MY_FIRST_CONTS value. No other implementation is set
export ClassB extends ClassA { readonly MY_FIRST_CONTS = 'other blaa'; readonly MY_SECOND_CONTS = 'other blaablaaa'; .... }
I constantly get the following error at the line of MY_FIRST_CONST in ClassB:
Property 'MY_FIRST_CONST' in type 'ClassB' is not assignable to the same property in base type 'ClassA'.
Type '"other blaa"' is not assignable to type '"blaa"'.
I do not get why this error comes and even less why it does not happen with MY_SECOND_CONST.
Any ideas? Thanks a lot!