Skip to content

Commit 6eb94ce

Browse files
committed
[TypeChecker] NFC: Add a test-case for rdar://problem/30906031
This problem has been fixed by @autoclosure rework.
1 parent 2c245b3 commit 6eb94ce

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/attr/attr_autoclosure.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,3 +203,10 @@ func rdar_20591571() {
203203
withoutActuallyEscaping(fn) { (_: () -> Int) in } // Ok
204204
}
205205
}
206+
207+
// rdar://problem/30906031 - [SR-4188]: withoutActuallyEscaping doesn't accept an @autoclosure argument
208+
func rdar_30906031(in arr: [Int], fn: @autoclosure () -> Int) -> Bool {
209+
return withoutActuallyEscaping(fn) { escapableF in // Ok
210+
arr.lazy.filter { $0 >= escapableF() }.isEmpty
211+
}
212+
}

0 commit comments

Comments
 (0)