We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ca3e3aa + 56de283 commit db09546Copy full SHA for db09546
test/SILOptimizer/noimplicitcopy_trivial.swift
@@ -1093,8 +1093,6 @@ public func test3(i: consuming Int) -> Int {
1093
takeClosure { i }
1094
}
1095
1096
-// TODO: incorrect diagnostic:
1097
-// error: 'i' cannot be captured by an escaping closure since it is a borrowed parameter
1098
-// public func test4(i: borrowing Int) -> Int {
1099
-// takeClosure { i }
1100
-// }
+public func test4(i: borrowing Int) -> Int { // expected-error {{'i' cannot be captured by an escaping closure}}
+ takeClosure { i } // expected-note {{closure capturing 'i' here}}
+}
0 commit comments