Swift non-escaping closure used escapingly in ObjC should trigger compilation error

Originator:an00na
Number:rdar://29772207 Date Originated:21-Dec-2016 10:35 AM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 8.2 (8C38)
Classification:Other Bug Reproducible:Always
 
Summary:
Swift non-escaping closure used escapingly in ObjC should trigger compilation error, just like called in Swift.

In a mixed project, after migrating from Swift 2 to Swift 3, one closure is not correctly migrated to escaping, maybe because it is only called in ObjC code. However, it compiles successfully and caused runtime error which is very hard to figure out.


Steps to Reproduce:
1. Open sample project.
2. See the correct compilation error for Swift code.
3. Fix it.
4. See no compilation error.
5. Read code in ObjCClass.m which has the same code that triggers error in ViewController.swift.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!