Skip to content

Commit 001d2ab

Browse files
committed
Avoid implicitly linking RegexBuilder symbol
1 parent fefb1bf commit 001d2ab

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)