Skip to content

Commit 93a3ebe

Browse files
committed
[stdlib] Make the rest of the shadow protocols internal
These shadow protocols don’t add any real type safety, and exposing them in the ABI seems unnecessary.
1 parent c4c4c17 commit 93a3ebe

File tree

4 files changed

+43
-7
lines changed

4 files changed

+43
-7
lines changed

stdlib/public/SDK/Foundation/NSDictionary.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ extension Dictionary {
4949
// The bug is fixed in: OS X 10.11.0, iOS 9.0, all versions of tvOS
5050
// and watchOS.
5151
self = Dictionary(
52-
_immutableCocoaDictionary: _cocoaDictionary.copy(with: nil))
52+
_immutableCocoaDictionary: _cocoaDictionary.copy(with: nil) as AnyObject)
5353
}
5454
}
5555

stdlib/public/SDK/Foundation/NSSet.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ extension Set {
2929
//
3030
// The bug is fixed in: OS X 10.11.0, iOS 9.0, all versions of tvOS
3131
// and watchOS.
32-
self = Set(_immutableCocoaSet: _cocoaSet.copy(with: nil))
32+
self = Set(_immutableCocoaSet: _cocoaSet.copy(with: nil) as AnyObject)
3333
}
3434
}
3535

stdlib/public/core/ShadowProtocols.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
import SwiftShims
2525

2626
@objc
27-
public protocol _ShadowProtocol {}
27+
internal protocol _ShadowProtocol {}
2828

2929
/// A shadow for the `NSFastEnumeration` protocol.
3030
@objc
31-
public protocol _NSFastEnumeration : _ShadowProtocol {
31+
internal protocol _NSFastEnumeration: _ShadowProtocol {
3232
@objc(countByEnumeratingWithState:objects:count:)
3333
func countByEnumerating(
3434
with state: UnsafeMutablePointer<_SwiftNSFastEnumerationState>,
@@ -38,17 +38,17 @@ public protocol _NSFastEnumeration : _ShadowProtocol {
3838

3939
/// A shadow for the `NSEnumerator` class.
4040
@objc
41-
public protocol _NSEnumerator : _ShadowProtocol {
41+
internal protocol _NSEnumerator: _ShadowProtocol {
4242
init()
4343
func nextObject() -> AnyObject?
4444
}
4545

4646
/// A token that can be used for `NSZone*`.
47-
public typealias _SwiftNSZone = OpaquePointer
47+
internal typealias _SwiftNSZone = OpaquePointer
4848

4949
/// A shadow for the `NSCopying` protocol.
5050
@objc
51-
public protocol _NSCopying : _ShadowProtocol {
51+
internal protocol _NSCopying: _ShadowProtocol {
5252
@objc(copyWithZone:)
5353
func copy(with zone: _SwiftNSZone?) -> AnyObject
5454
}

test/api-digester/Outputs/stability-stdlib-abi.swift.expected

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,3 +344,39 @@ Func _BridgeStorage.isUniquelyReferencedNative() has generic signature change fr
344344
Func _BridgeStorage.isUniquelyReferencedUnflaggedNative() has generic signature change from <τ_0_0, τ_0_1 where τ_0_0 : AnyObject, τ_0_1 : AnyObject> to <τ_0_0 where τ_0_0 : AnyObject>
345345
Struct _BridgeStorage has generic signature change from <τ_0_0, τ_0_1 where τ_0_0 : AnyObject, τ_0_1 : AnyObject> to <τ_0_0 where τ_0_0 : AnyObject>
346346
Var _BridgeStorage.objCInstance has declared type change from τ_0_1 to AnyObject
347+
348+
Class _ContiguousArrayStorage has removed conformance to _NSCopying
349+
Class _ContiguousArrayStorage has removed conformance to _NSFastEnumeration
350+
Class _ContiguousArrayStorage has removed conformance to _ShadowProtocol
351+
Class _DictionaryStorage has removed conformance to _NSCopying
352+
Class _DictionaryStorage has removed conformance to _NSFastEnumeration
353+
Class _DictionaryStorage has removed conformance to _ShadowProtocol
354+
Class _EmptyDictionarySingleton has removed conformance to _NSCopying
355+
Class _EmptyDictionarySingleton has removed conformance to _NSFastEnumeration
356+
Class _EmptyDictionarySingleton has removed conformance to _ShadowProtocol
357+
Class _EmptySetSingleton has removed conformance to _NSCopying
358+
Class _EmptySetSingleton has removed conformance to _NSFastEnumeration
359+
Class _EmptySetSingleton has removed conformance to _ShadowProtocol
360+
Class _SetStorage has removed conformance to _NSCopying
361+
Class _SetStorage has removed conformance to _NSFastEnumeration
362+
Class _SetStorage has removed conformance to _ShadowProtocol
363+
Class _SharedStringStorage has removed conformance to _NSCopying
364+
Class _SharedStringStorage has removed conformance to _ShadowProtocol
365+
Class _StringStorage has removed conformance to _NSCopying
366+
Class _StringStorage has removed conformance to _ShadowProtocol
367+
Class __ContiguousArrayStorageBase has removed conformance to _NSCopying
368+
Class __ContiguousArrayStorageBase has removed conformance to _NSFastEnumeration
369+
Class __ContiguousArrayStorageBase has removed conformance to _ShadowProtocol
370+
Class __EmptyArrayStorage has removed conformance to _NSCopying
371+
Class __EmptyArrayStorage has removed conformance to _NSFastEnumeration
372+
Class __EmptyArrayStorage has removed conformance to _ShadowProtocol
373+
Class __SwiftDeferredNSArray has removed conformance to _NSCopying
374+
Class __SwiftDeferredNSArray has removed conformance to _NSFastEnumeration
375+
Class __SwiftDeferredNSArray has removed conformance to _ShadowProtocol
376+
Class __SwiftNativeNSArrayWithContiguousStorage has removed conformance to _NSCopying
377+
Class __SwiftNativeNSArrayWithContiguousStorage has removed conformance to _NSFastEnumeration
378+
Class __SwiftNativeNSArrayWithContiguousStorage has removed conformance to _ShadowProtocol
379+
Protocol _NSCopying has been removed
380+
Protocol _NSEnumerator has been removed
381+
Protocol _NSFastEnumeration has been removed
382+
Protocol _ShadowProtocol has been removed

0 commit comments

Comments
 (0)