Consider this code in a Swift playground:
import Cocoa
class Thing: Printable {
let name: String
init() {
name = "something"
}
var description: String { return name }
}
let a = Thing()
println("hello, \(a)")
As an image:
Expected: I expect the last line to print "hello, something".
Observed: it prints "hello, __lldb_expr_1.Thing" as if I had not implemented the Printable protocol.
The code actually works in the context of a real iOS app where it prints "hello, something" using the Printable protocol as expected.
Why does this code not print what I expect in the playground? Is this a limitation of playgrounds?