Skip to content

Commit 6a0dd73

Browse files
authored
Merge pull request #5204 from jmschonfeld/implicit-regex-overload
Avoid implicitly linking RegexBuilder symbol
2 parents fefb1bf + 001d2ab commit 6a0dd73

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/plutil/PLUContext_KeyPaths.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ extension String {
1414
/// Key paths can contain a `.`, but it must be escaped with a backslash `\.`. This function splits up a keypath, honoring the ability to escape a `.`.
1515
internal func escapedKeyPathSplit() -> [String] {
1616
let escapesReplaced = self.replacing("\\.", with: "A_DOT_WAS_HERE")
17-
let split = escapesReplaced.split(separator: ".", omittingEmptySubsequences: false)
17+
// Explicitly specify Character(".") to avoid accidentally using an implicit RegexBuilder overload
18+
let split = escapesReplaced.split(separator: Character("."), omittingEmptySubsequences: false)
1819
return split.map { $0.replacingOccurrences(of: "A_DOT_WAS_HERE", with: ".") }
1920
}
2021
}

0 commit comments

Comments
 (0)