Why is it not allowed for TypeScript derived classes to have the same variable name, even if these members are private? Is there another way to achieve this, or am I making a mistake?
class ClassTS {
private nom: string = "ClassTS";
constructor() {
}
}
class ClassTSDer extends ClassTS {
private nom: string = "ClassTS";
constructor() {
super();
}
}
I came across this issue while practicing with TS.
Class 'ClassTSDer' incorrectly extends base class 'ClassTS'. Types have separate declarations of a private property 'nom'. ClassTSDer
class ClassTSDer
You could use protected; however, if I prefer not to use protected, do I need to use a different name?