1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
tests/cases/conformance/classes/members/accessibility/protectedClassPropertyAccessibleWithinNestedSubclass.ts(24,28): error TS2339: Property 'z' does not exist on type 'C'.
==== tests/cases/conformance/classes/members/accessibility/protectedClassPropertyAccessibleWithinNestedSubclass.ts (1 errors) ====
class B {
protected x: string;
protected static x: string;
}
class C extends B {
protected get y() { return this.x; }
protected set y(x) { this.y = this.x; }
protected foo() { return this.x; }
protected static get y() { return this.x; }
protected static set y(x) { this.y = this.x; }
protected static foo() { return this.x; }
protected static bar() { this.foo(); }
protected bar() {
class D {
protected foo() {
var c = new C();
var c1 = c.y;
var c2 = c.x;
var c3 = c.foo;
var c4 = c.bar;
var c5 = c.z; // error
~
!!! error TS2339: Property 'z' does not exist on type 'C'.
var sc1 = C.x;
var sc2 = C.y;
var sc3 = C.foo;
var sc4 = C.bar;
}
}
}
}
class E extends C {
protected z: string;
}
|