File: assignmentCompatWithObjectMembersAccessibility.errors.txt

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (232 lines) | stat: -rw-r--r-- 12,307 bytes parent folder | download | duplicates (4)
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(31,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'.
  Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(36,5): error TS2322: Type 'E' is not assignable to type 'Base'.
  Property 'foo' is private in type 'E' but not in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(41,5): error TS2322: Type 'E' is not assignable to type 'I'.
  Property 'foo' is private in type 'E' but not in type 'I'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(46,5): error TS2322: Type 'E' is not assignable to type 'D'.
  Property 'foo' is private in type 'E' but not in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(48,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'E'.
  Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(49,5): error TS2322: Type 'Base' is not assignable to type 'E'.
  Property 'foo' is private in type 'E' but not in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(50,5): error TS2322: Type 'I' is not assignable to type 'E'.
  Property 'foo' is private in type 'E' but not in type 'I'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(51,5): error TS2322: Type 'D' is not assignable to type 'E'.
  Property 'foo' is private in type 'E' but not in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(81,5): error TS2322: Type 'Base' is not assignable to type '{ foo: string; }'.
  Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(82,5): error TS2322: Type 'I' is not assignable to type '{ foo: string; }'.
  Property 'foo' is private in type 'I' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(84,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'.
  Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(86,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'Base'.
  Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(88,5): error TS2322: Type 'D' is not assignable to type 'Base'.
  Property 'foo' is private in type 'Base' but not in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(89,5): error TS2322: Type 'E' is not assignable to type 'Base'.
  Types have separate declarations of a private property 'foo'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(92,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'I'.
  Property 'foo' is private in type 'I' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(94,5): error TS2322: Type 'D' is not assignable to type 'I'.
  Property 'foo' is private in type 'I' but not in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(95,5): error TS2322: Type 'E' is not assignable to type 'I'.
  Types have separate declarations of a private property 'foo'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(99,5): error TS2322: Type 'Base' is not assignable to type 'D'.
  Property 'foo' is private in type 'Base' but not in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(100,5): error TS2322: Type 'I' is not assignable to type 'D'.
  Property 'foo' is private in type 'I' but not in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(101,5): error TS2322: Type 'E' is not assignable to type 'D'.
  Property 'foo' is private in type 'E' but not in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(103,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'E'.
  Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(104,5): error TS2322: Type 'Base' is not assignable to type 'E'.
  Types have separate declarations of a private property 'foo'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(105,5): error TS2322: Type 'I' is not assignable to type 'E'.
  Types have separate declarations of a private property 'foo'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2322: Type 'D' is not assignable to type 'E'.
  Property 'foo' is private in type 'E' but not in type 'D'.


==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts (24 errors) ====
    // members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M
    
    module TargetIsPublic {
        // targets
        class Base {
            public foo: string;
        }
    
        interface I {
            foo: string;
        }
    
        var a: { foo: string; }
        var b: Base;
        var i: I;
    
        // sources
        class D {
            public foo: string;
        }
    
        class E {
            private foo: string;
        }
        var d: D;
        var e: E;
    
        a = b;
        a = i;
        a = d;
        a = e; // error
        ~
!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }'.
!!! error TS2322:   Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
    
        b = a;
        b = i;
        b = d;
        b = e; // error
        ~
!!! error TS2322: Type 'E' is not assignable to type 'Base'.
!!! error TS2322:   Property 'foo' is private in type 'E' but not in type 'Base'.
    
        i = a;
        i = b;
        i = d;
        i = e; // error
        ~
!!! error TS2322: Type 'E' is not assignable to type 'I'.
!!! error TS2322:   Property 'foo' is private in type 'E' but not in type 'I'.
    
        d = a;
        d = b;
        d = i;
        d = e; // error
        ~
!!! error TS2322: Type 'E' is not assignable to type 'D'.
!!! error TS2322:   Property 'foo' is private in type 'E' but not in type 'D'.
    
        e = a; // errror
        ~
!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'E'.
!!! error TS2322:   Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
        e = b; // errror
        ~
!!! error TS2322: Type 'Base' is not assignable to type 'E'.
!!! error TS2322:   Property 'foo' is private in type 'E' but not in type 'Base'.
        e = i; // errror
        ~
!!! error TS2322: Type 'I' is not assignable to type 'E'.
!!! error TS2322:   Property 'foo' is private in type 'E' but not in type 'I'.
        e = d; // errror
        ~
!!! error TS2322: Type 'D' is not assignable to type 'E'.
!!! error TS2322:   Property 'foo' is private in type 'E' but not in type 'D'.
        e = e; 
    
    }
    
    module TargetIsPublic {
        // targets
        class Base {
            private foo: string;
        }
    
        interface I extends Base {
        }
    
        var a: { foo: string; }
        var b: Base;
        var i: I;
    
        // sources
        class D {
            public foo: string;
        }
    
        class E {
            private foo: string;
        }
    
        var d: D;
        var e: E;
    
        a = b; // error
        ~
!!! error TS2322: Type 'Base' is not assignable to type '{ foo: string; }'.
!!! error TS2322:   Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
        a = i; // error
        ~
!!! error TS2322: Type 'I' is not assignable to type '{ foo: string; }'.
!!! error TS2322:   Property 'foo' is private in type 'I' but not in type '{ foo: string; }'.
        a = d;
        a = e; // error
        ~
!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }'.
!!! error TS2322:   Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
    
        b = a; // error
        ~
!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'Base'.
!!! error TS2322:   Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
        b = i;
        b = d; // error
        ~
!!! error TS2322: Type 'D' is not assignable to type 'Base'.
!!! error TS2322:   Property 'foo' is private in type 'Base' but not in type 'D'.
        b = e; // error
        ~
!!! error TS2322: Type 'E' is not assignable to type 'Base'.
!!! error TS2322:   Types have separate declarations of a private property 'foo'.
        b = b;
        
        i = a; // error
        ~
!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'I'.
!!! error TS2322:   Property 'foo' is private in type 'I' but not in type '{ foo: string; }'.
        i = b;
        i = d; // error
        ~
!!! error TS2322: Type 'D' is not assignable to type 'I'.
!!! error TS2322:   Property 'foo' is private in type 'I' but not in type 'D'.
        i = e; // error
        ~
!!! error TS2322: Type 'E' is not assignable to type 'I'.
!!! error TS2322:   Types have separate declarations of a private property 'foo'.
        i = i;
    
        d = a;
        d = b; // error
        ~
!!! error TS2322: Type 'Base' is not assignable to type 'D'.
!!! error TS2322:   Property 'foo' is private in type 'Base' but not in type 'D'.
        d = i; // error
        ~
!!! error TS2322: Type 'I' is not assignable to type 'D'.
!!! error TS2322:   Property 'foo' is private in type 'I' but not in type 'D'.
        d = e; // error
        ~
!!! error TS2322: Type 'E' is not assignable to type 'D'.
!!! error TS2322:   Property 'foo' is private in type 'E' but not in type 'D'.
    
        e = a; // errror
        ~
!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'E'.
!!! error TS2322:   Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
        e = b; // errror
        ~
!!! error TS2322: Type 'Base' is not assignable to type 'E'.
!!! error TS2322:   Types have separate declarations of a private property 'foo'.
        e = i; // errror
        ~
!!! error TS2322: Type 'I' is not assignable to type 'E'.
!!! error TS2322:   Types have separate declarations of a private property 'foo'.
        e = d; // errror
        ~
!!! error TS2322: Type 'D' is not assignable to type 'E'.
!!! error TS2322:   Property 'foo' is private in type 'E' but not in type 'D'.
        e = e;
    
    }