Skip to content

Avoid implicitly linking RegexBuilder symbol #5204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Sources/plutil/PLUContext_KeyPaths.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ extension String {
/// 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 `.`.
internal func escapedKeyPathSplit() -> [String] {
let escapesReplaced = self.replacing("\\.", with: "A_DOT_WAS_HERE")
let split = escapesReplaced.split(separator: ".", omittingEmptySubsequences: false)
// Explicitly specify Character(".") to avoid accidentally using an implicit RegexBuilder overload
let split = escapesReplaced.split(separator: Character("."), omittingEmptySubsequences: false)
return split.map { $0.replacingOccurrences(of: "A_DOT_WAS_HERE", with: ".") }
}
}
Expand Down