@@ -8,7 +8,7 @@ let dict2: [Character: _] = ["h": 0]
8
8
let arr = [ _] ( repeating: " hi " , count: 3 )
9
9
10
10
func foo( _ arr: [ _ ] = [ 0 ] ) { } // expected-error {{type placeholder may not appear in top-level parameter}}
11
- // expected-note@-1 {{replace the placeholder with the correct type 'Int'}}
11
+ // expected-note@-1 {{replace the placeholder with the inferred type 'Int'}}
12
12
13
13
let foo = _. foo // expected-error {{could not infer type for placeholder}}
14
14
let zero : _ = . zero // expected-error {{cannot infer contextual base in reference to member 'zero'}}
@@ -76,32 +76,32 @@ where T: ExpressibleByIntegerLiteral, U: ExpressibleByIntegerLiteral {
76
76
77
77
extension Bar {
78
78
func frobnicate2( ) -> Bar < _ , _ > { // expected-error {{type placeholder may not appear in function return type}}
79
- // expected-note@-1 {{replace the placeholder with the correct type 'T'}}
80
- // expected-note@-2 {{replace the placeholder with the correct type 'U'}}
79
+ // expected-note@-1 {{replace the placeholder with the inferred type 'T'}}
80
+ // expected-note@-2 {{replace the placeholder with the inferred type 'U'}}
81
81
return Bar ( t: 42 , u: 42 )
82
82
}
83
83
func frobnicate3( ) -> Bar {
84
84
return Bar < _ , _ > ( t: 42 , u: 42 )
85
85
}
86
86
func frobnicate4( ) -> Bar < _ , _ > { // expected-error {{type placeholder may not appear in function return type}}
87
- // expected-note@-1 {{replace the placeholder with the correct type 'Int'}}
88
- // expected-note@-2 {{replace the placeholder with the correct type 'Int'}}
87
+ // expected-note@-1 {{replace the placeholder with the inferred type 'Int'}}
88
+ // expected-note@-2 {{replace the placeholder with the inferred type 'Int'}}
89
89
return Bar < _ , _ > ( t: 42 , u: 42 )
90
90
}
91
91
func frobnicate5( ) -> Bar < _ , U > { // expected-error {{type placeholder may not appear in function return type}}
92
- // expected-note@-1 {{replace the placeholder with the correct type 'T'}}
92
+ // expected-note@-1 {{replace the placeholder with the inferred type 'T'}}
93
93
return Bar ( t: 42 , u: 42 )
94
94
}
95
95
func frobnicate6( ) -> Bar {
96
96
return Bar < _ , U > ( t: 42 , u: 42 )
97
97
}
98
98
func frobnicate7( ) -> Bar < _ , _ > { // expected-error {{type placeholder may not appear in function return type}}
99
- // expected-note@-1 {{replace the placeholder with the correct type 'Int'}}
100
- // expected-note@-2 {{replace the placeholder with the correct type 'U'}}
99
+ // expected-note@-1 {{replace the placeholder with the inferred type 'Int'}}
100
+ // expected-note@-2 {{replace the placeholder with the inferred type 'U'}}
101
101
return Bar < _ , U > ( t: 42 , u: 42 )
102
102
}
103
103
func frobnicate8( ) -> Bar < _ , U > { // expected-error {{type placeholder may not appear in function return type}}
104
- // expected-note@-1 {{replace the placeholder with the correct type 'Int'}}
104
+ // expected-note@-1 {{replace the placeholder with the inferred type 'Int'}}
105
105
return Bar < _ , _ > ( t: 42 , u: 42 )
106
106
}
107
107
}
@@ -235,9 +235,9 @@ func mismatchedDefault<T>(_ x: [_] = [String: T]()) {} // expected-error {{type
235
235
236
236
func mismatchedReturnTypes( ) -> _ { // expected-error {{type placeholder may not appear in function return type}}
237
237
if true {
238
- return " " // expected-note@-2 {{replace the placeholder with the correct type 'String'}}
238
+ return " " // expected-note@-2 {{replace the placeholder with the inferred type 'String'}}
239
239
} else {
240
- return 0.5 // expected-note@-4 {{replace the placeholder with the correct type 'Double'}}
240
+ return 0.5 // expected-note@-4 {{replace the placeholder with the inferred type 'Double'}}
241
241
}
242
242
}
243
243
@@ -251,6 +251,6 @@ func opaque() -> some _ { // expected-error {{type placeholder not allowed here}
251
251
enum EnumWithPlaceholders {
252
252
case topLevelPlaceholder( x: _ ) // expected-error {{type placeholder may not appear in top-level parameter}}
253
253
case placeholderWithDefault( x: _ = 5 ) // expected-error {{type placeholder may not appear in top-level parameter}}
254
- // expected-note@-1 {{replace the placeholder with the correct type 'Int'}}
254
+ // expected-note@-1 {{replace the placeholder with the inferred type 'Int'}}
255
255
}
256
256
0 commit comments