2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/conformance/types/members/classWithPrivateProperty.ts(15,18): error TS2341: Property 'C.x' is inaccessible.
|
|
|
|
tests/cases/conformance/types/members/classWithPrivateProperty.ts(16,18): error TS2341: Property 'C.a' is inaccessible.
|
|
|
|
tests/cases/conformance/types/members/classWithPrivateProperty.ts(17,18): error TS2341: Property 'C.b' is inaccessible.
|
|
|
|
tests/cases/conformance/types/members/classWithPrivateProperty.ts(18,18): error TS2341: Property 'C.c' is inaccessible.
|
|
|
|
tests/cases/conformance/types/members/classWithPrivateProperty.ts(19,18): error TS2341: Property 'C.d' is inaccessible.
|
|
|
|
tests/cases/conformance/types/members/classWithPrivateProperty.ts(20,18): error TS2341: Property 'C.e' is inaccessible.
|
|
|
|
tests/cases/conformance/types/members/classWithPrivateProperty.ts(21,18): error TS2341: Property 'C.f' is inaccessible.
|
|
|
|
tests/cases/conformance/types/members/classWithPrivateProperty.ts(22,18): error TS2341: Property 'C.g' is inaccessible.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/conformance/types/members/classWithPrivateProperty.ts (8 errors) ====
|
|
|
|
// accessing any private outside the class is an error
|
|
|
|
|
|
|
|
class C {
|
|
|
|
private x;
|
|
|
|
private a = '';
|
|
|
|
private b: string = '';
|
|
|
|
private c() { return '' }
|
|
|
|
private d = () => '';
|
|
|
|
private static e;
|
|
|
|
private static f() { return '' }
|
|
|
|
private static g = () => '';
|
|
|
|
}
|
|
|
|
|
|
|
|
var c = new C();
|
|
|
|
var r1: string = c.x;
|
|
|
|
~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2341: Property 'C.x' is inaccessible.
|
2014-07-13 01:04:16 +02:00
|
|
|
var r2: string = c.a;
|
|
|
|
~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2341: Property 'C.a' is inaccessible.
|
2014-07-13 01:04:16 +02:00
|
|
|
var r3: string = c.b;
|
|
|
|
~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2341: Property 'C.b' is inaccessible.
|
2014-07-13 01:04:16 +02:00
|
|
|
var r4: string = c.c();
|
|
|
|
~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2341: Property 'C.c' is inaccessible.
|
2014-07-13 01:04:16 +02:00
|
|
|
var r5: string = c.d();
|
|
|
|
~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2341: Property 'C.d' is inaccessible.
|
2014-07-13 01:04:16 +02:00
|
|
|
var r6: string = C.e;
|
|
|
|
~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2341: Property 'C.e' is inaccessible.
|
2014-07-13 01:04:16 +02:00
|
|
|
var r7: string = C.f();
|
|
|
|
~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2341: Property 'C.f' is inaccessible.
|
2014-07-13 01:04:16 +02:00
|
|
|
var r8: string = C.g();
|
|
|
|
~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2341: Property 'C.g' is inaccessible.
|