Skip to content

Commit 3c9c517

Browse files
committed
Fix visibility on import triggering a compile warning
Previously, building sourcekit-lsp would produce the following warning when building on macOS: $ swift build Building for debugging... /Users/wilfred/src/sourcekit-lsp/Sources/SKLogging/CustomLogStringConvertible.swift:13:9: warning: package import of 'Foundation' was not used in package declarations 11 | //===----------------------------------------------------------------------===// 12 | 13 | package import Foundation | `- warning: package import of 'Foundation' was not used in package declarations Remove the visibility modifier, so no warning is produced.
1 parent d8a2a24 commit 3c9c517

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/SKLogging/CustomLogStringConvertible.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
// NSObject is defined in Foundation on non-darwin platforms. On
14+
// darwin, NSObject is package-visible.
15+
#if canImport(ObjectiveC)
16+
import Foundation
17+
#else
1318
package import Foundation
19+
#endif
1420

1521
#if !NO_CRYPTO_DEPENDENCY
1622
import Crypto

0 commit comments

Comments
 (0)