mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
String interpolation invokes convertFromStringInterpolationSegment() function now. There is no need to add extensions to String to allow custom types to participate in string interpolation. Just implementing Printable will do the right thing. Swift SVN r18104
21 lines
490 B
Swift
21 lines
490 B
Swift
// RUN: %target-run-simple-swift | FileCheck %s
|
|
|
|
// FIXME: rdar://16168414 big int interpolation isn't working on 32-bit
|
|
// XFAIL: PTRSIZE=32
|
|
|
|
var hello = "Hello"
|
|
var pi = 3
|
|
// CHECK: Hello, world. Pi is approximately 3.
|
|
println("\(hello), world. Pi is approximately \(pi).")
|
|
|
|
// CHECK: Nested "Hello, World!" with Pi = 3!
|
|
var HW = "\(hello), World!";
|
|
println("Nested \"\(HW)\" with Pi = \(pi)!")
|
|
|
|
|
|
// CHECK: value = 1099226349619
|
|
var someval = 0xFFeeFF0033
|
|
println("value = \(someval)")
|
|
|
|
|