Files
swift-mirror/test/refactoring/ConvertAsync/check_compiles.swift
Ben Barham fabb02100f [Test] Add @escaping to async refactoring tests
The async refactorings ignore whether a completion handler had
`@escaping` or not. In preparation of fixing this, fix up all functions
to have `@escaping` for their completion handler parameter.

Also some small miscellaneous fixes in order to reduce the number of
warnings output on test failures and also the addition of `REQUIRES:
concurrency` on all tests.
2021-07-24 09:53:17 +10:00

17 lines
367 B
Swift

// REQUIRES: concurrency
// RUN: %empty-directory(%t)
func simple(completion: @escaping () -> Void) { }
func anything() -> Bool { return true }
// RUN: %swift-frontend -typecheck %s
// RUN: not %refactor-check-compiles -convert-to-async -dump-text -source-filename %s -pos=%(line+1):6
func cannotCompile() {
simple {
if anything() {
return
}
}
}