mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Update static enforcement to look through noescape blocks to find an underlying noescape closure when a closure is converted to a block and passed as an argument to a function. This fixes a false negative when the closure performs an access that conflicts with an already in-progress access. These new diagnostics are warnings for source compatibility but will be upgraded to errors in the future. rdar://problem/32912660
12 lines
315 B
Swift
12 lines
315 B
Swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enforce-exclusivity=checked -swift-version 4 -emit-sil -primary-file %s -o /dev/null -verify
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
|
|
class SomeClass {
|
|
@objc
|
|
func testCallNoEscapeBlockDirectly(_ c: @convention(block) () -> ()) {
|
|
c()
|
|
}
|
|
}
|