typescript derived class cannot have the same variable name?
<p>Why can't typescript derived class have the same variable name? Even these members are private. Is there an alternative to this, or am I doing something wrong?</p>
<pre><code>class ClassTS {
    
    private nom: string = &quot;ClaseTS&quot;;
    
    constructor() {
            
    }
}

class ClassTSDer extends ClassTS {
    
    private nom: string = &quot;ClassTS&quot;;
    
    constructor() {
        super();
    }
}
</code></pre>
<p>I found this while practising with TS.</p>
<blockquote>
<p>Class 'ClassTSDer' incorrectly extends base class 'ClaseTS'. Types
have separate declarations of a private property 'nom'. ClassTSDer</p>
<p>class ClassTSDer</p>
</blockquote>
<p><em>you could, use protected</em>; yes but if I do not want to use protected, would I have to use another name?</p>