TypeScript/tests/baselines/reference/privateVisibility.errors.txt
2014-07-12 17:30:19 -07:00

33 lines
793 B
Plaintext

==== tests/cases/compiler/privateVisibility.ts (3 errors) ====
class Foo {
public pubMeth() {this.privMeth();}
private privMeth() {}
public pubProp = 0;
private privProp = 0;
}
var f = new Foo();
f.privMeth(); // should not work
~~~~~~~~~~
!!! Property 'Foo.privMeth' is inaccessible.
f.privProp; // should not work
~~~~~~~~~~
!!! Property 'Foo.privProp' is inaccessible.
f.pubMeth(); // should work
f.pubProp; // should work
module M {
export class C { public pub = 0; private priv = 1; }
export var V = 0;
}
var c = new M.C();
c.pub; // should work
c.priv; // should not work
~~~~~~
!!! Property 'M.C.priv' is inaccessible.