Files
swift-mirror/test/SILOptimizer/exclusivity_static_diagnostics_objc.swift
Devin Coughlin 88232d6e3b [Exclusivity] Look through block arguments to find noescape closures (#13497)
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
2017-12-19 13:38:09 -08:00

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()
}
}