Files
swift-mirror/test/Interpreter/Inputs/testability_helper.swift
Dave Abrahams ac3f047496 [stdlib] Renaming fallout from Mirror API review
toString(x)      => String(x)
toDebugString(x) => String(reflecting: x)
Printable        => CustomStringConvertible
DebugPrintable   => CustomDebugStringConvertible

Also updated comments to clarify these protocols

Swift SVN r27090
2015-04-07 20:32:26 +00:00

29 lines
567 B
Swift

// Things in this file are deliberately internal. The test harness uses @testable import.
internal class Base : CustomStringConvertible {
let id: Int
init(_ id: Int) {
self.id = id
}
var description: String { return "instance \(id)" }
private func privateFn() -> String {
return "private \(id)"
}
func callPrivate() -> String {
return privateFn()
}
}
private class PrivateSub : Base {
override func privateFn() -> String {
return "really private"
}
}
internal func getPrivateInstance() -> Base {
return PrivateSub(0)
}