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() {
83228322 }
83238323 }
83248324
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+
83258332 return false ;
83268333}
83278334
Original file line number Diff line number Diff line change @@ -270,3 +270,16 @@ func deferredInit(_ c: Bool) {
270270// https://github.com/apple/swift/issues/63130
271271let _: _ = nil // expected-error{{'nil' requires a contextual type}}
272272let _: _ ? = 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