File: memberFunctionsWithPublicPrivateOverloads.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (110 lines) | stat: -rw-r--r-- 7,036 bytes parent folder | download | duplicates (7)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
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.
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,11): error TS2341: Property 'foo' is private and only accessible within class 'C'.
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(62,12): error TS2341: Property 'foo' is private and only accessible within class 'D<T>'.


==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts (15 errors) ====
    class C {
        private foo(x: number);
        public foo(x: number, y: string); // error
               ~~~
!!! error TS2385: Overload signatures must all be public, private or protected.
        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.
        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.
        private static foo(x: any, y?: any) { }
    
        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) { }
    
        private static bar(x: 'hi');
        public static bar(x: string); // error
                      ~~~
!!! error TS2385: Overload signatures must all be public, private or protected.
        private static bar(x: number, y: string);
        private static bar(x: any, y?: any) { }
    
        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) { }
    }
    
    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.
        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.
        private bar(x: T, y: T);
        private bar(x: any, y?: any) { }
    
        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) { }
    
        private static foo(x: number);
        public static foo(x: number, y: string); // error
                      ~~~
!!! error TS2385: Overload signatures must all be public, private or protected.
        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.
        private static bar(x: number, y: string);
        private static bar(x: any, y?: any) { }
    
        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) { }
    }
    
    var c: C;
    var r = c.foo(1); // error
              ~~~
!!! error TS2341: Property 'foo' is private and only accessible within class 'C'.
    
    var d: D<number>;
    var r2 = d.foo(2); // error
               ~~~
!!! error TS2341: Property 'foo' is private and only accessible within class 'D<T>'.