Skip to content

Commit 08be3d2

Browse files
[tests] Add SR-12725 tests
1 parent 5ac1926 commit 08be3d2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/Constraints/diagnostics.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,3 +1470,10 @@ func gericArgToParamInout(_ x: inout [[Int]]) { // expected-note {{change variab
14701470
// expected-note@-1 {{arguments to generic parameter 'Element' ('Int' and 'String') are expected to be equal}}
14711471
// expected-error@-2 {{inout argument could be set to a value with a type other than '[[Int]]'; use a value declared as type '[[String]]?' instead}}
14721472
}
1473+
1474+
// SR-12725
1475+
struct SR12725<E> {} // expected-note {{arguments to generic parameter 'E' ('Int' and 'Double') are expected to be equal}}
1476+
func generic<T>(_ value: inout T, _ closure: (SR12725<T>) -> Void) {}
1477+
1478+
let arg: Int
1479+
generic(&arg) { (g: SR12725<Double>) -> Void in } // expected-error {{cannot convert value of type '(SR12725<Double>) -> Void' to expected argument type '(SR12725<Int>) -> Void'}}

0 commit comments

Comments
 (0)