mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
43 lines
891 B
TypeScript
43 lines
891 B
TypeScript
//// [tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingProtectedInstance.ts] ////
|
|
|
|
//// [derivedClassWithPrivateInstanceShadowingProtectedInstance.ts]
|
|
class Base {
|
|
protected x: string;
|
|
protected fn(): string {
|
|
return '';
|
|
}
|
|
|
|
protected get a() { return 1; }
|
|
protected set a(v) { }
|
|
}
|
|
|
|
// error, not a subtype
|
|
class Derived extends Base {
|
|
private x: string;
|
|
private fn(): string {
|
|
return '';
|
|
}
|
|
|
|
private get a() { return 1; }
|
|
private set a(v) { }
|
|
}
|
|
|
|
|
|
//// [derivedClassWithPrivateInstanceShadowingProtectedInstance.js]
|
|
"use strict";
|
|
class Base {
|
|
fn() {
|
|
return '';
|
|
}
|
|
get a() { return 1; }
|
|
set a(v) { }
|
|
}
|
|
// error, not a subtype
|
|
class Derived extends Base {
|
|
fn() {
|
|
return '';
|
|
}
|
|
get a() { return 1; }
|
|
set a(v) { }
|
|
}
|