Avatar
Avatar
Iceman
@swift-5.6.3 @swift-5.7.3 extension Substring { /// Converts all `\"` to `"`. func unescapingDoubleQuotes() -> Substring { self.lazy.split(separator: "\\").reduce(into: "") { (result, part) in if result.isEmpty || part.first == "\"" { result += part } else { result += "\\" + part } } } }
exit status: 1 with stderr:<stdin>:4:14: error: ambiguous use of 'split(separator:maxSplits:omittingEmptySubsequences:)' self.lazy.split(separator: "\\").reduce(into: "") { (result, part) in ^ Swift.Sequence:2:40: note: found this candidate @inlinable public __consuming func split(separator: Self.Element, maxSplits: Int = Int.max, omittingEmptySubsequences: Bool = true) -> [ArraySlice<Self.Element>] ^ Swift.Collection:2:40: note: found this candidate @inlinable public __consuming func split(separator: Self.Element, maxSplits: Int = Int.max, omittingEmptySubsequences: Bool = true) -> [Self.SubSequence] ^