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 {
1919 }
2020}
2121
22+ extension std . string : ExpressibleByStringLiteral {
23+ public init ( stringLiteral value: String ) {
24+ self . init ( value)
25+ }
26+ }
27+
2228extension String {
2329 public init ( cxxString: std . string ) {
2430 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") {
1616 let cxx2 = std. string ( " something123 " )
1717 let swift2 = String ( cxxString: cxx2)
1818 expectEqual ( swift2, " something123 " )
19+
20+ let cxx3 : std . string = " literal "
21+ expectEqual ( cxx3. size ( ) , 7 )
1922}
2023
2124extension std . string . const_iterator : UnsafeCxxInputIterator {
You can’t perform that action at this time.
0 commit comments