File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
test/Interop/Cxx/stdlib/overlay Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ extension std.string {
19
19
}
20
20
}
21
21
22
+ extension std . string : ExpressibleByStringLiteral {
23
+ public init ( stringLiteral value: String ) {
24
+ self . init ( value)
25
+ }
26
+ }
27
+
22
28
extension String {
23
29
public init ( cxxString: std . string ) {
24
30
self . init ( cString: cxxString. __c_strUnsafe ( ) )
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ StdStringOverlayTestSuite.test("std::string <=> Swift.String") {
16
16
let cxx2 = std. string ( " something123 " )
17
17
let swift2 = String ( cxxString: cxx2)
18
18
expectEqual ( swift2, " something123 " )
19
+
20
+ let cxx3 : std . string = " literal "
21
+ expectEqual ( cxx3. size ( ) , 7 )
19
22
}
20
23
21
24
extension std . string . const_iterator : UnsafeCxxInputIterator {
You can’t perform that action at this time.
0 commit comments