I deal with the following set of Typescript classes:
Firstly, we have an abstract class
export abstract class MyAbstractClass { ... }
Next is Class A which implements the methods from the abstract class
export ClassA extends MyAbstractClass { readonly MY_FIRST_CONST = 'blaa'; readonly MY_SECOND_CONST = 'blaablaaa'; ... }
Then, there's class B which extends class A and aims to override the value of MY_FIRST_CONST. No other changes have been made in the implementation
export ClassB extends ClassA { readonly MY_FIRST_CONST = 'other blaa'; readonly MY_SECOND_CONST = 'other blaablaaa'; ... }
When working on ClassB, I keep encountering the same error message at the line pertaining to MY_FIRST_CONST:
Property 'MY_FIRST_CONST' in type 'ClassB' is not assignable to the same property in base type 'ClassA'.
The error states: Type ""other blaa"" is not assignable to type ""blaa"".
I'm puzzled by the occurrence of this error, especially since it doesn't occur with MY_SECOND_CONST. Any insights or ideas on how to resolve this?