Skip to content

Commit 4d3aa95

Browse files
committed
Add regression test to close #42790
1 parent 649889f commit 4d3aa95

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/expr/closure/inference.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,12 @@ cc(1) // Ok
7777
func SR12955() {
7878
let f: @convention(c) (T) -> Void // expected-error {{cannot find type 'T' in scope}}
7979
}
80+
81+
// https://github.com/apple/swift/issues/42790
82+
do {
83+
func foo<T>(block: () -> ()) -> T.Type { T.self } // expected-note {{in call to function 'foo(block:)'}}
84+
85+
let x = foo { // expected-error {{generic parameter 'T' could not be inferred}}
86+
print("")
87+
}
88+
}

0 commit comments

Comments
 (0)