TypeScript/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.errors.txt

110 lines
6.9 KiB
Plaintext
Raw Normal View History

tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(3,12): error TS2385: Overload signatures must all be public, private or protected.
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(7,12): error TS2385: Overload signatures must all be public, private or protected.
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(12,19): error TS2385: Overload signatures must all be public, private or protected.
2014-09-23 20:22:38 +02:00
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(15,15): error TS2385: Overload signatures must all be public, private or protected.
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(16,15): error TS2385: Overload signatures must all be public, private or protected.
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(20,19): error TS2385: Overload signatures must all be public, private or protected.
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(25,19): error TS2385: Overload signatures must all be public, private or protected.
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(32,12): error TS2385: Overload signatures must all be public, private or protected.
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(36,12): error TS2385: Overload signatures must all be public, private or protected.
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(41,15): error TS2385: Overload signatures must all be public, private or protected.
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(45,19): error TS2385: Overload signatures must all be public, private or protected.
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(49,19): error TS2385: Overload signatures must all be public, private or protected.
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(53,19): error TS2385: Overload signatures must all be public, private or protected.
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(59,9): error TS2341: Property 'foo' is private and only accessible within class 'C'.
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(62,10): error TS2341: Property 'foo' is private and only accessible within class 'D<T>'.
2014-09-23 20:22:38 +02:00
==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts (15 errors) ====
2014-07-13 01:04:16 +02:00
class C {
private foo(x: number);
public foo(x: number, y: string); // error
~~~
!!! error TS2385: Overload signatures must all be public, private or protected.
2014-07-13 01:04:16 +02:00
private foo(x: any, y?: any) { }
private bar(x: 'hi');
public bar(x: string); // error
~~~
!!! error TS2385: Overload signatures must all be public, private or protected.
2014-07-13 01:04:16 +02:00
private bar(x: number, y: string);
private bar(x: any, y?: any) { }
private static foo(x: number);
public static foo(x: number, y: string); // error
~~~
!!! error TS2385: Overload signatures must all be public, private or protected.
2014-07-13 01:04:16 +02:00
private static foo(x: any, y?: any) { }
2014-09-23 20:22:38 +02:00
protected baz(x: string); // error
~~~
!!! error TS2385: Overload signatures must all be public, private or protected.
protected baz(x: number, y: string); // error
~~~
!!! error TS2385: Overload signatures must all be public, private or protected.
private baz(x: any, y?: any) { }
2014-07-13 01:04:16 +02:00
private static bar(x: 'hi');
public static bar(x: string); // error
~~~
!!! error TS2385: Overload signatures must all be public, private or protected.
2014-07-13 01:04:16 +02:00
private static bar(x: number, y: string);
private static bar(x: any, y?: any) { }
2014-09-23 20:22:38 +02:00
protected static baz(x: 'hi');
public static baz(x: string); // error
~~~
!!! error TS2385: Overload signatures must all be public, private or protected.
protected static baz(x: number, y: string);
protected static baz(x: any, y?: any) { }
2014-07-13 01:04:16 +02:00
}
class D<T> {
private foo(x: number);
public foo(x: T, y: T); // error
~~~
!!! error TS2385: Overload signatures must all be public, private or protected.
2014-07-13 01:04:16 +02:00
private foo(x: any, y?: any) { }
private bar(x: 'hi');
public bar(x: string); // error
~~~
!!! error TS2385: Overload signatures must all be public, private or protected.
2014-07-13 01:04:16 +02:00
private bar(x: T, y: T);
private bar(x: any, y?: any) { }
2014-09-23 20:22:38 +02:00
private baz(x: string);
protected baz(x: number, y: string); // error
~~~
!!! error TS2385: Overload signatures must all be public, private or protected.
private baz(x: any, y?: any) { }
2014-07-13 01:04:16 +02:00
private static foo(x: number);
public static foo(x: number, y: string); // error
~~~
!!! error TS2385: Overload signatures must all be public, private or protected.
2014-07-13 01:04:16 +02:00
private static foo(x: any, y?: any) { }
private static bar(x: 'hi');
public static bar(x: string); // error
~~~
!!! error TS2385: Overload signatures must all be public, private or protected.
2014-07-13 01:04:16 +02:00
private static bar(x: number, y: string);
private static bar(x: any, y?: any) { }
2014-09-23 20:22:38 +02:00
public static baz(x: string); // error
~~~
!!! error TS2385: Overload signatures must all be public, private or protected.
protected static baz(x: number, y: string);
protected static baz(x: any, y?: any) { }
2014-07-13 01:04:16 +02:00
}
var c: C;
var r = c.foo(1); // error
~~~~~
2014-09-19 15:37:55 +02:00
!!! error TS2341: Property 'foo' is private and only accessible within class 'C'.
2014-07-13 01:04:16 +02:00
var d: D<number>;
var r2 = d.foo(2); // error
~~~~~
2014-09-19 15:37:55 +02:00
!!! error TS2341: Property 'foo' is private and only accessible within class 'D<T>'.