461 lines
9.9 KiB
Text
461 lines
9.9 KiB
Text
|
=== tests/cases/compiler/privacyFunc.ts ===
|
||
|
module m1 {
|
||
|
>m1 : typeof m1
|
||
|
|
||
|
export class C1_public {
|
||
|
>C1_public : C1_public
|
||
|
|
||
|
private f1() {
|
||
|
>f1 : () => void
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class C2_private {
|
||
|
>C2_private : C2_private
|
||
|
}
|
||
|
|
||
|
export class C3_public {
|
||
|
>C3_public : C3_public
|
||
|
|
||
|
constructor (m1_c3_c1: C1_public);
|
||
|
>m1_c3_c1 : C1_public
|
||
|
>C1_public : C1_public
|
||
|
|
||
|
constructor (m1_c3_c2: C2_private); //error
|
||
|
>m1_c3_c2 : C2_private
|
||
|
>C2_private : C2_private
|
||
|
|
||
|
constructor (m1_c3_c1_2: any) {
|
||
|
>m1_c3_c1_2 : any
|
||
|
}
|
||
|
|
||
|
private f1_private(m1_c3_f1_arg: C1_public) {
|
||
|
>f1_private : (m1_c3_f1_arg: C1_public) => void
|
||
|
>m1_c3_f1_arg : C1_public
|
||
|
>C1_public : C1_public
|
||
|
}
|
||
|
|
||
|
public f2_public(m1_c3_f2_arg: C1_public) {
|
||
|
>f2_public : (m1_c3_f2_arg: C1_public) => void
|
||
|
>m1_c3_f2_arg : C1_public
|
||
|
>C1_public : C1_public
|
||
|
}
|
||
|
|
||
|
private f3_private(m1_c3_f3_arg: C2_private) {
|
||
|
>f3_private : (m1_c3_f3_arg: C2_private) => void
|
||
|
>m1_c3_f3_arg : C2_private
|
||
|
>C2_private : C2_private
|
||
|
}
|
||
|
|
||
|
public f4_public(m1_c3_f4_arg: C2_private) { // error
|
||
|
>f4_public : (m1_c3_f4_arg: C2_private) => void
|
||
|
>m1_c3_f4_arg : C2_private
|
||
|
>C2_private : C2_private
|
||
|
}
|
||
|
|
||
|
private f5_private() {
|
||
|
>f5_private : () => C1_public
|
||
|
|
||
|
return new C1_public();
|
||
|
>new C1_public() : C1_public
|
||
|
>C1_public : typeof C1_public
|
||
|
}
|
||
|
|
||
|
public f6_public() {
|
||
|
>f6_public : () => C1_public
|
||
|
|
||
|
return new C1_public();
|
||
|
>new C1_public() : C1_public
|
||
|
>C1_public : typeof C1_public
|
||
|
}
|
||
|
|
||
|
private f7_private() {
|
||
|
>f7_private : () => C2_private
|
||
|
|
||
|
return new C2_private();
|
||
|
>new C2_private() : C2_private
|
||
|
>C2_private : typeof C2_private
|
||
|
}
|
||
|
|
||
|
public f8_public() {
|
||
|
>f8_public : () => C2_private
|
||
|
|
||
|
return new C2_private(); // error
|
||
|
>new C2_private() : C2_private
|
||
|
>C2_private : typeof C2_private
|
||
|
}
|
||
|
|
||
|
private f9_private(): C1_public {
|
||
|
>f9_private : () => C1_public
|
||
|
>C1_public : C1_public
|
||
|
|
||
|
return new C1_public();
|
||
|
>new C1_public() : C1_public
|
||
|
>C1_public : typeof C1_public
|
||
|
}
|
||
|
|
||
|
public f10_public(): C1_public {
|
||
|
>f10_public : () => C1_public
|
||
|
>C1_public : C1_public
|
||
|
|
||
|
return new C1_public();
|
||
|
>new C1_public() : C1_public
|
||
|
>C1_public : typeof C1_public
|
||
|
}
|
||
|
|
||
|
private f11_private(): C2_private {
|
||
|
>f11_private : () => C2_private
|
||
|
>C2_private : C2_private
|
||
|
|
||
|
return new C2_private();
|
||
|
>new C2_private() : C2_private
|
||
|
>C2_private : typeof C2_private
|
||
|
}
|
||
|
|
||
|
public f12_public(): C2_private { // error
|
||
|
>f12_public : () => C2_private
|
||
|
>C2_private : C2_private
|
||
|
|
||
|
return new C2_private(); //error
|
||
|
>new C2_private() : C2_private
|
||
|
>C2_private : typeof C2_private
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class C4_private {
|
||
|
>C4_private : C4_private
|
||
|
|
||
|
constructor (m1_c4_c1: C1_public);
|
||
|
>m1_c4_c1 : C1_public
|
||
|
>C1_public : C1_public
|
||
|
|
||
|
constructor (m1_c4_c2: C2_private);
|
||
|
>m1_c4_c2 : C2_private
|
||
|
>C2_private : C2_private
|
||
|
|
||
|
constructor (m1_c4_c1_2: any) {
|
||
|
>m1_c4_c1_2 : any
|
||
|
}
|
||
|
private f1_private(m1_c4_f1_arg: C1_public) {
|
||
|
>f1_private : (m1_c4_f1_arg: C1_public) => void
|
||
|
>m1_c4_f1_arg : C1_public
|
||
|
>C1_public : C1_public
|
||
|
}
|
||
|
|
||
|
public f2_public(m1_c4_f2_arg: C1_public) {
|
||
|
>f2_public : (m1_c4_f2_arg: C1_public) => void
|
||
|
>m1_c4_f2_arg : C1_public
|
||
|
>C1_public : C1_public
|
||
|
}
|
||
|
|
||
|
private f3_private(m1_c4_f3_arg: C2_private) {
|
||
|
>f3_private : (m1_c4_f3_arg: C2_private) => void
|
||
|
>m1_c4_f3_arg : C2_private
|
||
|
>C2_private : C2_private
|
||
|
}
|
||
|
|
||
|
public f4_public(m1_c4_f4_arg: C2_private) {
|
||
|
>f4_public : (m1_c4_f4_arg: C2_private) => void
|
||
|
>m1_c4_f4_arg : C2_private
|
||
|
>C2_private : C2_private
|
||
|
}
|
||
|
|
||
|
|
||
|
private f5_private() {
|
||
|
>f5_private : () => C1_public
|
||
|
|
||
|
return new C1_public();
|
||
|
>new C1_public() : C1_public
|
||
|
>C1_public : typeof C1_public
|
||
|
}
|
||
|
|
||
|
public f6_public() {
|
||
|
>f6_public : () => C1_public
|
||
|
|
||
|
return new C1_public();
|
||
|
>new C1_public() : C1_public
|
||
|
>C1_public : typeof C1_public
|
||
|
}
|
||
|
|
||
|
private f7_private() {
|
||
|
>f7_private : () => C2_private
|
||
|
|
||
|
return new C2_private();
|
||
|
>new C2_private() : C2_private
|
||
|
>C2_private : typeof C2_private
|
||
|
}
|
||
|
|
||
|
public f8_public() {
|
||
|
>f8_public : () => C2_private
|
||
|
|
||
|
return new C2_private();
|
||
|
>new C2_private() : C2_private
|
||
|
>C2_private : typeof C2_private
|
||
|
}
|
||
|
|
||
|
|
||
|
private f9_private(): C1_public {
|
||
|
>f9_private : () => C1_public
|
||
|
>C1_public : C1_public
|
||
|
|
||
|
return new C1_public();
|
||
|
>new C1_public() : C1_public
|
||
|
>C1_public : typeof C1_public
|
||
|
}
|
||
|
|
||
|
public f10_public(): C1_public {
|
||
|
>f10_public : () => C1_public
|
||
|
>C1_public : C1_public
|
||
|
|
||
|
return new C1_public();
|
||
|
>new C1_public() : C1_public
|
||
|
>C1_public : typeof C1_public
|
||
|
}
|
||
|
|
||
|
private f11_private(): C2_private {
|
||
|
>f11_private : () => C2_private
|
||
|
>C2_private : C2_private
|
||
|
|
||
|
return new C2_private();
|
||
|
>new C2_private() : C2_private
|
||
|
>C2_private : typeof C2_private
|
||
|
}
|
||
|
|
||
|
public f12_public(): C2_private {
|
||
|
>f12_public : () => C2_private
|
||
|
>C2_private : C2_private
|
||
|
|
||
|
return new C2_private();
|
||
|
>new C2_private() : C2_private
|
||
|
>C2_private : typeof C2_private
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export class C5_public {
|
||
|
>C5_public : C5_public
|
||
|
|
||
|
constructor (m1_c5_c: C1_public) {
|
||
|
>m1_c5_c : C1_public
|
||
|
>C1_public : C1_public
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class C6_private {
|
||
|
>C6_private : C6_private
|
||
|
|
||
|
constructor (m1_c6_c: C1_public) {
|
||
|
>m1_c6_c : C1_public
|
||
|
>C1_public : C1_public
|
||
|
}
|
||
|
}
|
||
|
export class C7_public {
|
||
|
>C7_public : C7_public
|
||
|
|
||
|
constructor (m1_c7_c: C2_private) { // error
|
||
|
>m1_c7_c : C2_private
|
||
|
>C2_private : C2_private
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class C8_private {
|
||
|
>C8_private : C8_private
|
||
|
|
||
|
constructor (m1_c8_c: C2_private) {
|
||
|
>m1_c8_c : C2_private
|
||
|
>C2_private : C2_private
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function f1_public(m1_f1_arg: C1_public) {
|
||
|
>f1_public : (m1_f1_arg: C1_public) => void
|
||
|
>m1_f1_arg : C1_public
|
||
|
>C1_public : C1_public
|
||
|
}
|
||
|
|
||
|
export function f2_public(m1_f2_arg: C1_public) {
|
||
|
>f2_public : (m1_f2_arg: C1_public) => void
|
||
|
>m1_f2_arg : C1_public
|
||
|
>C1_public : C1_public
|
||
|
}
|
||
|
|
||
|
function f3_public(m1_f3_arg: C2_private) {
|
||
|
>f3_public : (m1_f3_arg: C2_private) => void
|
||
|
>m1_f3_arg : C2_private
|
||
|
>C2_private : C2_private
|
||
|
}
|
||
|
|
||
|
export function f4_public(m1_f4_arg: C2_private) { // error
|
||
|
>f4_public : (m1_f4_arg: C2_private) => void
|
||
|
>m1_f4_arg : C2_private
|
||
|
>C2_private : C2_private
|
||
|
}
|
||
|
|
||
|
|
||
|
function f5_public() {
|
||
|
>f5_public : () => C1_public
|
||
|
|
||
|
return new C1_public();
|
||
|
>new C1_public() : C1_public
|
||
|
>C1_public : typeof C1_public
|
||
|
}
|
||
|
|
||
|
export function f6_public() {
|
||
|
>f6_public : () => C1_public
|
||
|
|
||
|
return new C1_public();
|
||
|
>new C1_public() : C1_public
|
||
|
>C1_public : typeof C1_public
|
||
|
}
|
||
|
|
||
|
function f7_public() {
|
||
|
>f7_public : () => C2_private
|
||
|
|
||
|
return new C2_private();
|
||
|
>new C2_private() : C2_private
|
||
|
>C2_private : typeof C2_private
|
||
|
}
|
||
|
|
||
|
export function f8_public() {
|
||
|
>f8_public : () => C2_private
|
||
|
|
||
|
return new C2_private(); // error
|
||
|
>new C2_private() : C2_private
|
||
|
>C2_private : typeof C2_private
|
||
|
}
|
||
|
|
||
|
|
||
|
function f9_private(): C1_public {
|
||
|
>f9_private : () => C1_public
|
||
|
>C1_public : C1_public
|
||
|
|
||
|
return new C1_public();
|
||
|
>new C1_public() : C1_public
|
||
|
>C1_public : typeof C1_public
|
||
|
}
|
||
|
|
||
|
export function f10_public(): C1_public {
|
||
|
>f10_public : () => C1_public
|
||
|
>C1_public : C1_public
|
||
|
|
||
|
return new C1_public();
|
||
|
>new C1_public() : C1_public
|
||
|
>C1_public : typeof C1_public
|
||
|
}
|
||
|
|
||
|
function f11_private(): C2_private {
|
||
|
>f11_private : () => C2_private
|
||
|
>C2_private : C2_private
|
||
|
|
||
|
return new C2_private();
|
||
|
>new C2_private() : C2_private
|
||
|
>C2_private : typeof C2_private
|
||
|
}
|
||
|
|
||
|
export function f12_public(): C2_private { // error
|
||
|
>f12_public : () => C2_private
|
||
|
>C2_private : C2_private
|
||
|
|
||
|
return new C2_private(); //error
|
||
|
>new C2_private() : C2_private
|
||
|
>C2_private : typeof C2_private
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class C6_public {
|
||
|
>C6_public : C6_public
|
||
|
}
|
||
|
|
||
|
class C7_public {
|
||
|
>C7_public : C7_public
|
||
|
|
||
|
constructor (c7_c2: C6_public);
|
||
|
>c7_c2 : C6_public
|
||
|
>C6_public : C6_public
|
||
|
|
||
|
constructor (c7_c1_2: any) {
|
||
|
>c7_c1_2 : any
|
||
|
}
|
||
|
private f1_private(c7_f1_arg: C6_public) {
|
||
|
>f1_private : (c7_f1_arg: C6_public) => void
|
||
|
>c7_f1_arg : C6_public
|
||
|
>C6_public : C6_public
|
||
|
}
|
||
|
|
||
|
public f2_public(c7_f2_arg: C6_public) {
|
||
|
>f2_public : (c7_f2_arg: C6_public) => void
|
||
|
>c7_f2_arg : C6_public
|
||
|
>C6_public : C6_public
|
||
|
}
|
||
|
|
||
|
private f5_private() {
|
||
|
>f5_private : () => C6_public
|
||
|
|
||
|
return new C6_public();
|
||
|
>new C6_public() : C6_public
|
||
|
>C6_public : typeof C6_public
|
||
|
}
|
||
|
|
||
|
public f6_public() {
|
||
|
>f6_public : () => C6_public
|
||
|
|
||
|
return new C6_public();
|
||
|
>new C6_public() : C6_public
|
||
|
>C6_public : typeof C6_public
|
||
|
}
|
||
|
|
||
|
private f9_private(): C6_public {
|
||
|
>f9_private : () => C6_public
|
||
|
>C6_public : C6_public
|
||
|
|
||
|
return new C6_public();
|
||
|
>new C6_public() : C6_public
|
||
|
>C6_public : typeof C6_public
|
||
|
}
|
||
|
|
||
|
public f10_public(): C6_public {
|
||
|
>f10_public : () => C6_public
|
||
|
>C6_public : C6_public
|
||
|
|
||
|
return new C6_public();
|
||
|
>new C6_public() : C6_public
|
||
|
>C6_public : typeof C6_public
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class C9_public {
|
||
|
>C9_public : C9_public
|
||
|
|
||
|
constructor (c9_c: C6_public) {
|
||
|
>c9_c : C6_public
|
||
|
>C6_public : C6_public
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
function f4_public(f4_arg: C6_public) {
|
||
|
>f4_public : (f4_arg: C6_public) => void
|
||
|
>f4_arg : C6_public
|
||
|
>C6_public : C6_public
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
function f6_public() {
|
||
|
>f6_public : () => C6_public
|
||
|
|
||
|
return new C6_public();
|
||
|
>new C6_public() : C6_public
|
||
|
>C6_public : typeof C6_public
|
||
|
}
|
||
|
|
||
|
|
||
|
function f10_public(): C6_public {
|
||
|
>f10_public : () => C6_public
|
||
|
>C6_public : C6_public
|
||
|
|
||
|
return new C6_public();
|
||
|
>new C6_public() : C6_public
|
||
|
>C6_public : typeof C6_public
|
||
|
}
|
||
|
|