File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
SwiftCompilerSources/Sources/Basic Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -79,11 +79,15 @@ public extension NoReflectionChildren {
7979// StringRef
8080//===----------------------------------------------------------------------===//
8181
82- public struct StringRef : CustomStringConvertible , NoReflectionChildren {
82+ public struct StringRef : CustomStringConvertible , NoReflectionChildren , ExpressibleByStringLiteral {
8383 public let _bridged : BridgedStringRef
8484
8585 public init ( bridged: BridgedStringRef ) { self . _bridged = bridged }
8686
87+ public init ( stringLiteral: StaticString ) {
88+ self . _bridged = BridgedStringRef ( data: stringLiteral. utf8Start, count: stringLiteral. utf8CodeUnitCount)
89+ }
90+
8791 public var string : String { String ( _bridged) }
8892 public var description : String { string }
8993
You can’t perform that action at this time.
0 commit comments