Xcode6-Beta (6A215l): Printable protocol doesn't appear to affect println in playgrounds

Originator:adam
Number:rdar://17245102 Date Originated:10-Jun-2014 01:51 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode6-Beta (6A215l)
Classification:Other Bug Reproducible:Always
 
Summary:
Printable protocol doesn't appear to affect println in playgrounds

Steps to Reproduce:
Use attached playground code

Expected Results:
Console output would reflect the description given

Actual Results:
V11lldb_expr_08MyStruct (has 1 child)

Regression:


Notes:
// Playground - noun: a place where people can play

import UIKit

var array = Array(count: 7, repeatedValue:NSObject())

var names = array.map{$0.description}.reduce("Hi", combine: {$0 + $1})

names

// names is ~:
//["<NSObject: 0x10d015930>", "<NSObject: 0x10d015930>", "<NSObject: 0x10d015930>", "<NSObject: 0x10d015930>", "<NSObject: 0x10d015930>", "<NSObject: 0x10d015930>", "<NSObject: 0x10d015930>"]

struct MyStruct: Comparable, Printable {
    var variable: Int?
    var description: String {
        return "This is my struct (\(variable))"
    }
}

operator infix ~ {}

func == (lhs: MyStruct, rhs: MyStruct) -> Bool {
    return lhs.variable == rhs.variable
}

func ~ (lhs: MyStruct, rhs: MyStruct) -> MyStruct? {
    return MyStruct(variable:lhs.variable! % rhs.variable!)
}

func < (lhs: MyStruct, rhs: MyStruct) -> Bool {
    return lhs.variable < rhs.variable
}

var sta = MyStruct(variable:0)
var stb = MyStruct(variable:9)

sta == stb
sta ~ stb
sta >= stb

println(sta)

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!