Swift 1.2 Cannot Call Objective-C Methods With Pointer Parameter

Originator:wjk011
Number:rdar://19899425 Date Originated:2015-02-19
Status:Open Resolved:
Product:OS X SDK Product Version:Xcode build 6D520o
Classification:Other Bug Reproducible:Always
 
Summary:
Under Swift 1.2 as included in Xcode 6.3 build 6D520o, trying to call an Objective-C method with a parameter bridged to type “AutoreleasingUnsafeMutablePointer<T>”, where T is an optional type, is not possible. The Swift compiler emits the following error: “Cannot invoke 'scanCharactersFromSet' with an argument list of type '(NSCharacterSet, intoString: inout String)'” Calling a method using this type where T is not optional works just fine.

Steps to Reproduce:
1. Install Xcode 6.3 beta, build 6D520o.
2. Open the playground file attached to this radar
3. Observe the error; it should occur on line #9.

Expected Results:
The project or playground should compile with no errors.

Actual Results:
The project or playground does not compile, and the Swift compiler emits the following error:

Cannot invoke 'scanCharactersFromSet' with an argument list of type '(NSCharacterSet, intoString: inout String)'

Version:
Xcode build 6D520o, OS X build 14C109

Notes:
There is no workaround that I know of; even calling a method where the parameter in question is annotated as "__nonnull" does not work.

Configuration:
Xcode 6.3 beta 6D520o on model "MacBookPro11,1".

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!