@@ -16,21 +16,21 @@ extension Int {
16
16
// https://github.com/swiftlang/swift/issues/74857
17
17
func test( i: Int ) {
18
18
let _ = i . foo < Int > ( )
19
- // expected-swift5-warning@-1 {{cannot explicitly specialize a generic function }}
20
- // expected-swift6-error@-2 {{cannot explicitly specialize a generic function }}
19
+ // expected-swift5-warning@-1 {{cannot explicitly specialize instance method 'foo()' }}
20
+ // expected-swift6-error@-2 {{cannot explicitly specialize instance method 'foo()' }}
21
21
22
22
let _ = i . gen < Int > ( )
23
- // expected-swift5-warning@-1 {{cannot explicitly specialize a generic function }}
24
- // expected-swift6-error@-2 {{cannot explicitly specialize a generic function }}
23
+ // expected-swift5-warning@-1 {{cannot explicitly specialize instance method 'gen()' }}
24
+ // expected-swift6-error@-2 {{cannot explicitly specialize instance method 'gen()' }}
25
25
// expected-error@-3 {{generic parameter 'T' could not be inferred}}
26
26
27
27
let _ = 0 . foo< Int> ( )
28
- // expected-swift5-warning@-1 {{cannot explicitly specialize a generic function }}
29
- // expected-swift6-error@-2 {{cannot explicitly specialize a generic function }}
28
+ // expected-swift5-warning@-1 {{cannot explicitly specialize instance method 'foo()' }}
29
+ // expected-swift6-error@-2 {{cannot explicitly specialize instance method 'foo()' }}
30
30
31
31
let _ = i. gen< Int>
32
- // expected-swift5-warning@-1 {{cannot explicitly specialize a generic function }}
33
- // expected-swift6-error@-2 {{cannot explicitly specialize a generic function }}
32
+ // expected-swift5-warning@-1 {{cannot explicitly specialize instance method 'gen()' }}
33
+ // expected-swift6-error@-2 {{cannot explicitly specialize instance method 'gen()' }}
34
34
// expected-error@-3 {{generic parameter 'T' could not be inferred}}
35
35
let _ = i. bar< Int>
36
36
// expected-swift5-error@-1 {{cannot specialize non-generic type 'Int'}}
@@ -45,8 +45,8 @@ extension Bool {
45
45
}
46
46
47
47
let _: ( ) -> Bool = false . foo< Int>
48
- // expected-swift5-warning@-1 {{cannot explicitly specialize a generic function }}
49
- // expected-swift6-error@-2 {{cannot explicitly specialize a generic function }}
48
+ // expected-swift5-warning@-1 {{cannot explicitly specialize instance method 'foo()' }}
49
+ // expected-swift6-error@-2 {{cannot explicitly specialize instance method 'foo()' }}
50
50
51
51
func foo( _ x: Int) {
52
52
_ = {
62
62
}
63
63
64
64
_ = Test . init< Int> ( { ( _: Int ) -> Void in } )
65
- // expected-swift5-warning@-1 {{cannot explicitly specialize a generic function }}
66
- // expected-swift6-error@-2 {{cannot explicitly specialize a generic function }}
65
+ // expected-swift5-warning@-1 {{cannot explicitly specialize initializer 'init(_:)' }}
66
+ // expected-swift6-error@-2 {{cannot explicitly specialize initializer 'init(_:)' }}
67
67
}
0 commit comments