Skip to content

Commit c30b165

Browse files
committed
Guard OSLog calls on all platforms, not just macOS
We only guarded the usage of `Logger` by an OS version on macOS, not on other Apple platforms. Add those platforms the `#available` clause as well. Fixes #1883 rdar://111865186
1 parent 0d39318 commit c30b165

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SwiftSyntaxBuilder/SyntaxParsable+ExpressibleByStringInterpolation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extension SyntaxParseable {
2727
/// are on a platform that supports OSLog, otherwise don't do anything.
2828
private func logStringInterpolationParsingError() {
2929
#if canImport(OSLog) && !SWIFTSYNTAX_NO_OSLOG_DEPENDENCY
30-
if #available(macOS 11.0, *) {
30+
if #available(macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, macCatalyst 14.0, *) {
3131
let diagnostics = ParseDiagnosticsGenerator.diagnostics(for: self)
3232
let formattedDiagnostics = DiagnosticsFormatter().annotatedSource(tree: self, diags: diagnostics)
3333
Logger(subsystem: "SwiftSyntax", category: "ParseError").fault(

0 commit comments

Comments
 (0)