Skip to content

Commit 5b8f2d8

Browse files
authored
Fix Sessions on Xcode 13 (#10800)
1 parent 8c68475 commit 5b8f2d8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

FirebaseSessions/Sources/Development/NanoPB+CustomStringConvertible.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ extension firebase_appquality_sessions_LogEnvironment: CustomStringConvertible {
103103
}
104104
}
105105

106-
extension UnsafeMutablePointer<pb_bytes_array_t>: CustomStringConvertible {
106+
// This is written like this for Swift backwards-compatibility.
107+
// Once we upgrade to Xcode 14, this can be written as
108+
// UnsafeMutablePointer<pb_bytes_array_t>
109+
extension UnsafeMutablePointer: CustomStringConvertible where Pointee == pb_bytes_array_t {
107110
public var description: String {
108111
let decoded = FIRSESDecodeString(self)
109112
if decoded.count == 0 {
@@ -114,7 +117,11 @@ extension UnsafeMutablePointer<pb_bytes_array_t>: CustomStringConvertible {
114117
}
115118

116119
// For an optional field
117-
extension UnsafeMutablePointer<pb_bytes_array_t>?: CustomStringConvertible {
120+
// This is written like this for Swift backwards-compatibility.
121+
// Once we upgrade to Xcode 14, this can be written as
122+
// UnsafeMutablePointer<pb_bytes_array_t>?
123+
extension Optional: CustomStringConvertible
124+
where Wrapped == UnsafeMutablePointer<pb_bytes_array_t> {
118125
public var description: String {
119126
guard let this = self else {
120127
return "<NULL>"

0 commit comments

Comments
 (0)