2014-09-19 23:01:07 +02:00
|
|
|
=== tests/cases/conformance/classes/members/accessibility/protectedClassPropertyAccessibleWithinSubclass.ts ===
|
|
|
|
// no errors
|
|
|
|
|
|
|
|
class B {
|
2015-04-13 23:01:57 +02:00
|
|
|
>B : B, Symbol(B, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 0, 0))
|
2014-09-19 23:01:07 +02:00
|
|
|
|
|
|
|
protected x: string;
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : string, Symbol(x, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 2, 9))
|
2014-09-19 23:01:07 +02:00
|
|
|
|
|
|
|
protected static x: string;
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : string, Symbol(B.x, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 3, 24))
|
2014-09-19 23:01:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
class C extends B {
|
2015-04-13 23:01:57 +02:00
|
|
|
>C : C, Symbol(C, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 5, 1))
|
|
|
|
>B : B, Symbol(B, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 0, 0))
|
2014-09-19 23:01:07 +02:00
|
|
|
|
|
|
|
protected get y() { return this.x; }
|
2015-04-13 23:01:57 +02:00
|
|
|
>y : string, Symbol(y, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 7, 19), Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 8, 40))
|
|
|
|
>this.x : string, Symbol(B.x, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 2, 9))
|
|
|
|
>this : C, Symbol(C, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 5, 1))
|
|
|
|
>x : string, Symbol(B.x, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 2, 9))
|
2014-09-19 23:01:07 +02:00
|
|
|
|
|
|
|
protected set y(x) { this.y = this.x; }
|
2015-04-13 23:01:57 +02:00
|
|
|
>y : string, Symbol(y, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 7, 19), Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 8, 40))
|
|
|
|
>x : string, Symbol(x, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 9, 20))
|
2014-09-19 23:01:07 +02:00
|
|
|
>this.y = this.x : string
|
2015-04-13 23:01:57 +02:00
|
|
|
>this.y : string, Symbol(y, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 7, 19), Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 8, 40))
|
|
|
|
>this : C, Symbol(C, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 5, 1))
|
|
|
|
>y : string, Symbol(y, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 7, 19), Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 8, 40))
|
|
|
|
>this.x : string, Symbol(B.x, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 2, 9))
|
|
|
|
>this : C, Symbol(C, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 5, 1))
|
|
|
|
>x : string, Symbol(B.x, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 2, 9))
|
2014-09-19 23:01:07 +02:00
|
|
|
|
|
|
|
protected foo() { return this.x; }
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo : () => string, Symbol(foo, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 9, 43))
|
|
|
|
>this.x : string, Symbol(B.x, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 2, 9))
|
|
|
|
>this : C, Symbol(C, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 5, 1))
|
|
|
|
>x : string, Symbol(B.x, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 2, 9))
|
2014-09-19 23:01:07 +02:00
|
|
|
|
|
|
|
protected bar() { return this.foo(); }
|
2015-04-13 23:01:57 +02:00
|
|
|
>bar : () => string, Symbol(bar, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 10, 38))
|
2014-09-19 23:01:07 +02:00
|
|
|
>this.foo() : string
|
2015-04-13 23:01:57 +02:00
|
|
|
>this.foo : () => string, Symbol(foo, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 9, 43))
|
|
|
|
>this : C, Symbol(C, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 5, 1))
|
|
|
|
>foo : () => string, Symbol(foo, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 9, 43))
|
2014-09-19 23:01:07 +02:00
|
|
|
|
|
|
|
protected static get y() { return this.x; }
|
2015-04-13 23:01:57 +02:00
|
|
|
>y : string, Symbol(C.y, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 11, 42), Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 13, 47))
|
|
|
|
>this.x : string, Symbol(B.x, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 3, 24))
|
|
|
|
>this : typeof C, Symbol(C, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 5, 1))
|
|
|
|
>x : string, Symbol(B.x, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 3, 24))
|
2014-09-19 23:01:07 +02:00
|
|
|
|
|
|
|
protected static set y(x) { this.y = this.x; }
|
2015-04-13 23:01:57 +02:00
|
|
|
>y : string, Symbol(C.y, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 11, 42), Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 13, 47))
|
|
|
|
>x : string, Symbol(x, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 14, 27))
|
2014-09-19 23:01:07 +02:00
|
|
|
>this.y = this.x : string
|
2015-04-13 23:01:57 +02:00
|
|
|
>this.y : string, Symbol(C.y, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 11, 42), Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 13, 47))
|
|
|
|
>this : typeof C, Symbol(C, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 5, 1))
|
|
|
|
>y : string, Symbol(C.y, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 11, 42), Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 13, 47))
|
|
|
|
>this.x : string, Symbol(B.x, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 3, 24))
|
|
|
|
>this : typeof C, Symbol(C, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 5, 1))
|
|
|
|
>x : string, Symbol(B.x, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 3, 24))
|
2014-09-19 23:01:07 +02:00
|
|
|
|
|
|
|
protected static foo() { return this.x; }
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo : () => string, Symbol(C.foo, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 14, 50))
|
|
|
|
>this.x : string, Symbol(B.x, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 3, 24))
|
|
|
|
>this : typeof C, Symbol(C, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 5, 1))
|
|
|
|
>x : string, Symbol(B.x, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 3, 24))
|
2014-09-19 23:01:07 +02:00
|
|
|
|
|
|
|
protected static bar() { this.foo(); }
|
2015-04-13 23:01:57 +02:00
|
|
|
>bar : () => void, Symbol(C.bar, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 15, 45))
|
2014-09-19 23:01:07 +02:00
|
|
|
>this.foo() : string
|
2015-04-13 23:01:57 +02:00
|
|
|
>this.foo : () => string, Symbol(C.foo, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 14, 50))
|
|
|
|
>this : typeof C, Symbol(C, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 5, 1))
|
|
|
|
>foo : () => string, Symbol(C.foo, Decl(protectedClassPropertyAccessibleWithinSubclass.ts, 14, 50))
|
2014-09-19 23:01:07 +02:00
|
|
|
}
|
|
|
|
|