Swift.String.UTF16View support for Sliceable doesn't work

Originator:zwaldowski
Number:rdar://18854943 Date Originated:3 Nov 2014
Status:Closed Resolved:false
Product:Developer Tools Product Version:Xcode 6.1 (6A1052d), Swift 1.1 (600.0.54.20)
Classification:Other Bug Reproducible:Always
 
Summary:
When retrieving a UTF16View for a Swift String, using the methods from Sliceable to access the UTF16View always returns the same UTF16View, without any truncation.

Steps to Reproduce:
1. Set up a Swift project
2. Declare a String
3. Attempt to use the String's .utf16 property.

Expected Results:
Using "prefix(string.utf16, n)" returns a UTF16View that is truncated.

Actual Results:
An identical UTF16View is returned from any function that relies on Sliceable.

Comments

This issue has been observed as fixed in Swift 1.2 and Xcode Version 6.3 (6D520o).

This issue has been verified as resolved and can be closed.

By zwaldowski at Feb. 10, 2015, 2:53 a.m. (reply...)

Attachments: 'NoTruncation.playground.zip' was successfully uploaded.

https://dl.dropboxusercontent.com/u/11013527/NoTruncation.playground.zip

By zwaldowski at Nov. 3, 2014, 7:03 p.m. (reply...)

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!