Skip to content

Commit e42037a

Browse files
committed
Restore AllCases Default
While we cannot yet remove the synthesis of AllCases without some extra coordination with the SDKs, we can at least leave the default behind since it is always going to be correct, if a little duplicative.
1 parent 3d6c6b4 commit e42037a

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

stdlib/public/core/CompilerProtocols.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ extension RawRepresentable where RawValue: Hashable, Self: Hashable {
249249
/// demonstrates this automatic implementation.
250250
public protocol CaseIterable {
251251
/// A type that can represent a collection of all values of this type.
252-
associatedtype AllCases: Collection
252+
associatedtype AllCases: Collection = [Self]
253253
where AllCases.Element == Self
254254

255255
/// A collection of all values of this type.

test/IDE/complete_override.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -896,11 +896,10 @@ struct SynthesizedConformance3: Hashable {
896896
enum SynthesizedConformance4: CaseIterable {
897897
case a, b, c, d
898898
#^OVERRIDE_SYNTHESIZED_4^#
899-
// OVERRIDE_SYNTHESIZED_4: Begin completions, 4 items
899+
// OVERRIDE_SYNTHESIZED_4: Begin completions, 3 items
900900
// OVERRIDE_SYNTHESIZED_4-DAG: Decl[InstanceVar]/Super/IsSystem: var hashValue: Int
901901
// OVERRIDE_SYNTHESIZED_4-DAG: Decl[InstanceMethod]/Super/IsSystem: func hash(into hasher: inout Hasher) {|};
902902
// OVERRIDE_SYNTHESIZED_4-DAG: Decl[StaticVar]/Super/IsSystem: static var allCases: [SynthesizedConformance4];
903-
// OVERRIDE_SYNTHESIZED_4-DAG: Decl[AssociatedType]/Super/IsSystem: typealias AllCases = {#(Type)#};
904903
}
905904

906905
class SynthesizedConformance5: SynthesizedConformance2 {

0 commit comments

Comments
 (0)