File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -8322,6 +8322,13 @@ bool CouldNotInferPlaceholderType::diagnoseAsError() {
8322
8322
}
8323
8323
}
8324
8324
8325
+ // When placeholder type appears in an editor placeholder i.e.
8326
+ // `<#T##() -> _#>` we rely on the parser to produce a diagnostic
8327
+ // about editor placeholder and glance over all placeholder type
8328
+ // inference issues.
8329
+ if (isExpr<EditorPlaceholderExpr>(getAnchor ()))
8330
+ return true ;
8331
+
8325
8332
return false ;
8326
8333
}
8327
8334
Original file line number Diff line number Diff line change @@ -270,3 +270,16 @@ func deferredInit(_ c: Bool) {
270
270
// https://github.com/apple/swift/issues/63130
271
271
let _: _ = nil // expected-error{{'nil' requires a contextual type}}
272
272
let _: _ ? = nil // expected-error{{'nil' requires a contextual type}}
273
+
274
+ // rdar://106621760 - failed to produce a diagnostic when placeholder type appears in editor placeholder
275
+ do {
276
+ struct X < T> {
277
+ init ( content: ( ) -> T ) { }
278
+ }
279
+
280
+ func test( _: ( ) -> Void ) { }
281
+
282
+ test {
283
+ _ = X ( content: < #T##( ) - > _#> ) // expected-error {{editor placeholder in source file}}
284
+ }
285
+ }
You can’t perform that action at this time.
0 commit comments