Skip to content

Use internal import instead of implementationOnly import #5109

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Sources/Foundation/Bridging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//
//===----------------------------------------------------------------------===//

@_implementationOnly import CoreFoundation
internal import CoreFoundation

#if canImport(ObjectiveC)
import ObjectiveC
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/Bundle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation

@_silgen_name("swift_getTypeContextDescriptor")
private func _getTypeContextDescriptor(of cls: AnyClass) -> UnsafeRawPointer
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/DateComponents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//
//===----------------------------------------------------------------------===//

@_implementationOnly import CoreFoundation
internal import CoreFoundation

extension DateComponents : ReferenceConvertible {
public typealias ReferenceType = NSDateComponents
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/DateFormatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation
@_spi(SwiftCorelibsFoundation) import FoundationEssentials
internal import Synchronization

Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/DateInterval.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//
//===----------------------------------------------------------------------===//

@_implementationOnly import CoreFoundation
internal import CoreFoundation

extension DateInterval : _ObjectiveCBridgeable {
public static func _isBridgedToObjectiveC() -> Bool {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/DateIntervalFormatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation

internal let kCFDateIntervalFormatterNoStyle = CFDateIntervalFormatterStyle.noStyle
internal let kCFDateIntervalFormatterShortStyle = CFDateIntervalFormatterStyle.shortStyle
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/Dictionary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation

extension Dictionary : _ObjectiveCBridgeable {

Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/FileHandle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation
#if canImport(Dispatch)
import Dispatch
#endif
Expand Down
4 changes: 2 additions & 2 deletions Sources/Foundation/FileManager+POSIX.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ internal func &(left: UInt32, right: mode_t) -> mode_t {
}
#endif

@_implementationOnly import CoreFoundation
internal import CoreFoundation
internal import Synchronization

#if os(WASI)
Expand All @@ -32,7 +32,7 @@ internal var O_WRONLY: Int32 { _getConst_O_WRONLY() }
fileprivate let previousStatxFailed = Mutex(false)
#endif

@_implementationOnly import CoreFoundation
internal import CoreFoundation

extension FileManager {
internal func _mountedVolumeURLs(includingResourceValuesForKeys propertyKeys: [URLResourceKey]?, options: VolumeEnumerationOptions = []) -> [URL]? {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/FileManager+Win32.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation

#if os(Windows)
import let WinSDK.INVALID_FILE_ATTRIBUTES
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/FileManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fileprivate let SF_IMMUTABLE: Int32 = 1
fileprivate let UF_HIDDEN: Int32 = 1
#endif

@_implementationOnly import CoreFoundation
internal import CoreFoundation
#if os(Windows)
import CRT
import WinSDK
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/Host.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation
#if os(Windows)
import WinSDK
#endif
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/ISO8601DateFormatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation

extension ISO8601DateFormatter {

Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/JSONSerialization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//
//===----------------------------------------------------------------------===//

@_implementationOnly import CoreFoundation
internal import CoreFoundation

extension JSONSerialization {
public struct ReadingOptions : OptionSet, Sendable {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/Measurement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//===----------------------------------------------------------------------===//

#if DEPLOYMENT_RUNTIME_SWIFT
@_implementationOnly import CoreFoundation
internal import CoreFoundation
#else
@_exported import Foundation // Clang module
import _SwiftCoreFoundationOverlayShims
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSArray.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation

@available(*, unavailable)
extension NSArray : @unchecked Sendable { }
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSAttributedString.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation

extension NSAttributedString {
public struct Key: RawRepresentable, Equatable, Hashable, Sendable {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSCFArray.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//


@_implementationOnly import CoreFoundation
internal import CoreFoundation

internal final class _NSCFArray : NSMutableArray {
deinit {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSCFBoolean.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//


@_implementationOnly import CoreFoundation
internal import CoreFoundation

internal class __NSCFBoolean : NSNumber, @unchecked Sendable {
override var hash: Int {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSCFCharacterSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2016 Apple. All rights reserved.
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation

internal class _NSCFCharacterSet : NSMutableCharacterSet {

Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSCFDictionary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//


@_implementationOnly import CoreFoundation
internal import CoreFoundation

internal final class _NSCFDictionary : NSMutableDictionary {
deinit {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSCFSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//


@_implementationOnly import CoreFoundation
internal import CoreFoundation

internal final class _NSCFSet : NSMutableSet {
deinit {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSCFString.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//


@_implementationOnly import CoreFoundation
internal import CoreFoundation

@usableFromInline
internal class _NSCFString : NSMutableString {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSCalendar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation
@_spi(SwiftCorelibsFoundation) @_exported import FoundationEssentials

internal let kCFCalendarUnitEra = CFCalendarUnit.era
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSCharacterSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//


@_implementationOnly import CoreFoundation
internal import CoreFoundation

let kCFCharacterSetControl = CFCharacterSetPredefinedSet.control
let kCFCharacterSetWhitespace = CFCharacterSetPredefinedSet.whitespace
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSConcreteValue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation
internal import Synchronization

internal class NSConcreteValue : NSValue, @unchecked Sendable {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation
#if !os(WASI)
import Dispatch
#endif
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSDate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation

public typealias TimeInterval = Double

Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSDateComponents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//

@_exported import FoundationEssentials
@_implementationOnly import CoreFoundation
internal import CoreFoundation


// This is a just used as an extensible struct, basically;
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSDictionary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//


@_implementationOnly import CoreFoundation
internal import CoreFoundation

#if !os(WASI)
import Dispatch
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Glibc
import CRT
#endif

@_implementationOnly import CoreFoundation
internal import CoreFoundation
internal import Synchronization

public typealias NSErrorDomain = NSString
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSKeyedArchiver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation
internal import Synchronization

/// Archives created using the class method `archivedData(withRootObject:)` use this key
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSKeyedArchiverHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation

extension CFKeyedArchiverUID : _NSBridgeable {
typealias NSType = _NSKeyedArchiverUID
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSKeyedCoderOldStyleArray.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation

internal final class _NSKeyedCoderOldStyleArray : NSObject, NSCopying, NSSecureCoding, NSCoding {

Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSKeyedUnarchiver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation
internal import Synchronization

@available(*, unavailable)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSLocale.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//


@_implementationOnly import CoreFoundation
internal import CoreFoundation
@_spi(SwiftCorelibsFoundation) @_exported import FoundationEssentials
@_exported import FoundationInternationalization

Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSLock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation

#if canImport(Glibc)
import Glibc
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSLog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation

/* Output from NSLogv is serialized, in that only one thread in a process can be doing
* the writing/logging described above at a time. All attempts at writing/logging a
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSNumber.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//


@_implementationOnly import CoreFoundation
internal import CoreFoundation
@_spi(SwiftCorelibsFoundation) @_exported import FoundationEssentials

internal let kCFNumberSInt8Type = CFNumberType.sInt8Type
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSObjCRuntime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//


@_implementationOnly import CoreFoundation
internal import CoreFoundation

internal let kCFCompareLessThan = CFComparisonResult.compareLessThan
internal let kCFCompareEqualTo = CFComparisonResult.compareEqualTo
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@_exported import Dispatch
#endif

@_implementationOnly import CoreFoundation
internal import CoreFoundation

/// The `NSObjectProtocol` groups methods that are fundamental to all Foundation objects.
///
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSPathUtilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//

@_implementationOnly import CoreFoundation
internal import CoreFoundation
#if os(Windows)
import WinSDK
#elseif os(WASI)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSRange.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#if DEPLOYMENT_RUNTIME_SWIFT

@_implementationOnly import CoreFoundation
internal import CoreFoundation

public struct _NSRange : Sendable {
public var location: Int
Expand Down
Loading