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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(3,19): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(4,19): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(8,26): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(9,26): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(15,3): error TS2445: Property 'x' is protected and only accessible within class 'C' and its subclasses.
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(16,3): error TS2445: Property 'y' is protected and only accessible within class 'C' and its subclasses.
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(17,3): error TS2445: Property 'y' is protected and only accessible within class 'C' and its subclasses.
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(18,3): error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses.
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(20,3): error TS2445: Property 'a' is protected and only accessible within class 'C' and its subclasses.
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(21,3): error TS2445: Property 'b' is protected and only accessible within class 'C' and its subclasses.
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(22,3): error TS2445: Property 'b' is protected and only accessible within class 'C' and its subclasses.
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(23,3): error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses.
==== tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts (12 errors) ====
class C {
protected x: string;
protected get y() { return null; }
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
protected set y(x) { }
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
protected foo() { }
protected static a: string;
protected static get b() { return null; }
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
protected static set b(x) { }
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
protected static foo() { }
}
var c: C;
// all errors
c.x;
~
!!! error TS2445: Property 'x' is protected and only accessible within class 'C' and its subclasses.
c.y;
~
!!! error TS2445: Property 'y' is protected and only accessible within class 'C' and its subclasses.
c.y = 1;
~
!!! error TS2445: Property 'y' is protected and only accessible within class 'C' and its subclasses.
c.foo();
~~~
!!! error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses.
C.a;
~
!!! error TS2445: Property 'a' is protected and only accessible within class 'C' and its subclasses.
C.b();
~
!!! error TS2445: Property 'b' is protected and only accessible within class 'C' and its subclasses.
C.b = 1;
~
!!! error TS2445: Property 'b' is protected and only accessible within class 'C' and its subclasses.
C.foo();
~~~
!!! error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses.
|