[Swift] [Xcode 6E35b] Mirror struct can't reflect on value passed as Any

Originator:jernej.strasner
Number:rdar://21961383 Date Originated:23-Jul-2015 05:01 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 6.4 (6E35b)
Classification:Enhancement Reproducible:Always
 
Summary:
Swift can’t properly reflect on a value of type Any

Steps to Reproduce:

let e: Any = [["a":40],["as":9]]

func printDisplayStyle<Value>(value: Value) {
    let mirror = Mirror(reflecting: value)
    print(mirror.displayStyle)
    mirror.children.map{ printDisplayStyle($0) }
}

printDisplayStyle(e)

Expected Results:
Prints the display style of e (Collection) and it’s children (Dictionary).

Actual Results:
The displayStyle property is nil. Children collection is empty.

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!