@@ -23,12 +23,15 @@ static const ModuleContextDescriptor *module() {
23
23
});
24
24
}
25
25
26
- template <unsigned N>
27
- static ProtocolSpecifier globalProtocol () {
26
+ static ProtocolSpecifier P () {
28
27
return protocol (buildGlobalProtocolDescriptor (module (), [] {
29
- std::ostringstream str;
30
- str << " Anonymous" << N;
31
- return str.str ();
28
+ return " P" ;
29
+ }));
30
+ }
31
+
32
+ static ProtocolSpecifier Q () {
33
+ return protocol (buildGlobalProtocolDescriptor (module (), [] {
34
+ return " Q" ;
32
35
}));
33
36
}
34
37
@@ -209,32 +212,32 @@ TEST(TestExtendedExistential, shapeUniquing) {
209
212
return shape (
210
213
genSig (param ()),
211
214
reqSig (param (),
212
- conforms (reqParam (0 ), globalProtocol< 0 > ()),
213
- sameType (member (reqParam (0 ), " Element" ), genParam (0 )))
215
+ conforms (reqParam (0 ), P ()),
216
+ sameType (member (reqParam (0 ), P (), " Element" ), genParam (0 )))
214
217
);
215
218
});
216
219
auto shape1 = buildGlobalNonUniqueShape (567 , []{
217
220
return shape (
218
221
genSig (param ()),
219
222
reqSig (param (),
220
- conforms (reqParam (0 ), globalProtocol< 0 > ()),
221
- sameType (member (reqParam (0 ), " Element" ), genParam (0 )))
223
+ conforms (reqParam (0 ), P ()),
224
+ sameType (member (reqParam (0 ), P (), " Element" ), genParam (0 )))
222
225
);
223
226
});
224
227
auto shape2 = buildGlobalNonUniqueShape (1123 , []{
225
228
return shape (
226
229
genSig (param ()),
227
230
reqSig (param (),
228
- conforms (reqParam (0 ), globalProtocol< 1 > ()),
229
- sameType (member (reqParam (0 ), " Element" ), genParam (0 )))
231
+ conforms (reqParam (0 ), Q ()),
232
+ sameType (member (reqParam (0 ), Q (), " Element" ), genParam (0 )))
230
233
);
231
234
});
232
235
auto shape3 = buildGlobalNonUniqueShape (1123 , []{
233
236
return shape (
234
237
genSig (param ()),
235
238
reqSig (param (),
236
- conforms (reqParam (0 ), globalProtocol< 1 > ()),
237
- sameType (member (reqParam (0 ), " Element" ), genParam (0 )))
239
+ conforms (reqParam (0 ), Q ()),
240
+ sameType (member (reqParam (0 ), Q (), " Element" ), genParam (0 )))
238
241
);
239
242
});
240
243
@@ -265,7 +268,7 @@ TEST(TestExtendedExistential, nullaryMetadata) {
265
268
auto shape1 = buildGlobalShape ([]{
266
269
return shape (
267
270
reqSig (param (),
268
- conforms (reqParam (0 ), globalProtocol< 0 > ()))
271
+ conforms (reqParam (0 ), P ()))
269
272
);
270
273
});
271
274
auto metadata1 = swift_getExtendedExistentialTypeMetadata_unique (shape1, nullptr );
@@ -281,14 +284,14 @@ TEST(TestExtendedExistential, unaryMetadata) {
281
284
return shape (
282
285
genSig (param ()),
283
286
reqSig (param (),
284
- conforms (reqParam (0 ), globalProtocol< 0 > ()))
287
+ conforms (reqParam (0 ), P ()))
285
288
);
286
289
});
287
290
auto shape2 = buildGlobalShape ([]{
288
291
return shape (
289
292
genSig (param ()),
290
293
reqSig (param (),
291
- conforms (reqParam (0 ), globalProtocol< 1 > ()))
294
+ conforms (reqParam (0 ), Q ()))
292
295
);
293
296
});
294
297
@@ -328,7 +331,7 @@ TEST(TestExtendedExistential, binaryMetadata) {
328
331
return shape (
329
332
genSig (param (), param ()),
330
333
reqSig (param (),
331
- conforms (reqParam (0 ), globalProtocol< 0 > ()))
334
+ conforms (reqParam (0 ), P ()))
332
335
);
333
336
});
334
337
@@ -396,7 +399,7 @@ TEST(TestExtendedExistential, defaultOpaqueValueWitnessses) {
396
399
auto shape1 = buildGlobalShape ([]{
397
400
return shape (
398
401
reqSig (param (),
399
- conforms (reqParam (0 ), globalProtocol< 0 > ()))
402
+ conforms (reqParam (0 ), P ()))
400
403
);
401
404
});
402
405
auto metadata1 = swift_getExtendedExistentialTypeMetadata_unique (shape1, nullptr );
@@ -408,8 +411,8 @@ TEST(TestExtendedExistential, defaultOpaqueValueWitnessses) {
408
411
auto shape2 = buildGlobalShape ([]{
409
412
return shape (
410
413
reqSig (param (),
411
- conforms (reqParam (0 ), globalProtocol< 0 > ()),
412
- conforms (reqParam (0 ), globalProtocol< 1 > ()))
414
+ conforms (reqParam (0 ), P ()),
415
+ conforms (reqParam (0 ), Q ()))
413
416
);
414
417
});
415
418
auto metadata2 = swift_getExtendedExistentialTypeMetadata_unique (shape2, nullptr );
@@ -438,7 +441,7 @@ TEST(TestExtendedExistential, defaultClassValueWitnessses) {
438
441
return shape (
439
442
special (SpecialKind::Class),
440
443
reqSig (param (),
441
- conforms (reqParam (0 ), globalProtocol< 0 > ()))
444
+ conforms (reqParam (0 ), P ()))
442
445
);
443
446
});
444
447
auto metadata1 = swift_getExtendedExistentialTypeMetadata_unique (shape1, nullptr );
@@ -451,8 +454,8 @@ TEST(TestExtendedExistential, defaultClassValueWitnessses) {
451
454
return shape (
452
455
special (SpecialKind::Class),
453
456
reqSig (param (),
454
- conforms (reqParam (0 ), globalProtocol< 0 > ()),
455
- conforms (reqParam (0 ), globalProtocol< 1 > ()))
457
+ conforms (reqParam (0 ), P ()),
458
+ conforms (reqParam (0 ), Q ()))
456
459
);
457
460
});
458
461
auto metadata2 = swift_getExtendedExistentialTypeMetadata_unique (shape2, nullptr );
@@ -481,7 +484,7 @@ TEST(TestExtendedExistential, defaultMetatypeValueWitnessses) {
481
484
return shape (
482
485
special (SpecialKind::Metatype),
483
486
reqSig (param (),
484
- conforms (reqParam (0 ), globalProtocol< 0 > ()))
487
+ conforms (reqParam (0 ), P ()))
485
488
);
486
489
});
487
490
auto metadata1 = swift_getExtendedExistentialTypeMetadata_unique (shape1, nullptr );
@@ -494,8 +497,8 @@ TEST(TestExtendedExistential, defaultMetatypeValueWitnessses) {
494
497
return shape (
495
498
special (SpecialKind::Metatype),
496
499
reqSig (param (),
497
- conforms (reqParam (0 ), globalProtocol< 0 > ()),
498
- conforms (reqParam (0 ), globalProtocol< 1 > ()))
500
+ conforms (reqParam (0 ), P ()),
501
+ conforms (reqParam (0 ), Q ()))
499
502
);
500
503
});
501
504
auto metadata2 = swift_getExtendedExistentialTypeMetadata_unique (shape2, nullptr );
0 commit comments