9
9
func testUnifyingGenericParams< T, U> ( x: T ) -> some Collection where T == U {
10
10
// expected-warning@-1 {{same-type requirement makes generic parameters 'U' and 'T' equivalent}}
11
11
return [ ]
12
+ // expected-warning@-1 {{empty collection literal requires an explicit type}}
12
13
}
13
14
14
15
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test0C22UnifyingGenericParams21xQrx_tSlRz7ElementQzRs_r0_lF
15
16
func testUnifyingGenericParams2< T, U> ( x: T ) -> some Collection where T: Collection , U == T . Element {
16
17
return [ ]
18
+ // expected-warning@-1 {{empty collection literal requires an explicit type}}
17
19
}
18
20
19
21
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test0C24ConcretizingGenericParam1xQrSi_tSiRszlF
20
22
func testConcretizingGenericParam< T> ( x: T ) -> some Collection where T == Int {
21
23
// expected-warning@-1 {{same-type requirement makes generic parameter 'T' non-generic}}
22
24
return [ ]
25
+ // expected-warning@-1 {{empty collection literal requires an explicit type}}
23
26
}
24
27
25
28
struct GenericContext < T> {
26
29
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test14GenericContextV0c8UnifyingD6Params1xQrx_tqd__RszlF
27
30
func testUnifyingGenericParams< U> ( x: T ) -> some Collection where T == U {
28
31
// expected-warning@-1 {{same-type requirement makes generic parameters 'U' and 'T' equivalent}}
29
32
return [ ]
33
+ // expected-warning@-1 {{empty collection literal requires an explicit type}}
30
34
}
31
35
32
36
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test14GenericContextV0c8UnifyingD7Params21xQrx_tSlRz7ElementQzRsd__lF
33
37
func testUnifyingGenericParams2< U> ( x: T ) -> some Collection where T: Collection , U == T . Element {
34
38
return [ ]
39
+ // expected-warning@-1 {{empty collection literal requires an explicit type}}
35
40
}
36
41
37
42
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test14GenericContextVyQrxcqd__Rszluip
@@ -40,6 +45,7 @@ struct GenericContext<T> {
40
45
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test14GenericContextVyQrxcqd__Rszluig
41
46
get {
42
47
return [ ]
48
+ // expected-warning@-1 {{empty collection literal requires an explicit type}}
43
49
}
44
50
}
45
51
}
@@ -48,6 +54,7 @@ extension GenericContext where T == Int {
48
54
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test14GenericContextVAASiRszlE0c12ConcretizingD5Param1xQrSi_tF
49
55
func testConcretizingGenericParam( x: T ) -> some Collection {
50
56
return [ ]
57
+ // expected-warning@-1 {{empty collection literal requires an explicit type}}
51
58
}
52
59
}
53
60
@@ -58,19 +65,22 @@ extension TooGenericTooContext where T == U {
58
65
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test010TooGenericD7ContextVAAq_RszrlE0c8UnifyingE6Params1xQrx_tF
59
66
func testUnifyingGenericParams( x: T ) -> some Collection {
60
67
return [ ]
68
+ // expected-warning@-1 {{empty collection literal requires an explicit type}}
61
69
}
62
70
}
63
71
64
72
extension TooGenericTooContext where T: Collection , U == T . Element {
65
73
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test010TooGenericD7ContextVAASlRz7ElementQzRs_rlE0c8UnifyingE7Params21xQrx_tF
66
74
func testUnifyingGenericParams2( x: T ) -> some Collection {
67
75
return [ ]
76
+ // expected-warning@-1 {{empty collection literal requires an explicit type}}
68
77
}
69
78
}
70
79
extension TooGenericTooContext where T == Int {
71
80
// CHECK: [[@LINE+1]]:{{[0-9]+}} s:14swift_ide_test010TooGenericD7ContextVAASiRszrlE0c12ConcretizingE5Param1xQrSi_tF
72
81
func testConcretizingGenericParam( x: T ) -> some Collection {
73
82
return [ ]
83
+ // expected-warning@-1 {{empty collection literal requires an explicit type}}
74
84
}
75
85
}
76
86
0 commit comments