Skip to content

Commit fdeedd1

Browse files
authored
Merge pull request #44 from cwakamo/eng/PR-59141771-PlaygroundLogger-Swift-5-language-mode
[PlaygroundLogger] Migrated PlaygroundLogger and its tests to Swift 5.
2 parents 50d96fe + b3132d9 commit fdeedd1

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

PlaygroundLogger/PlaygroundLogger.xcodeproj/project.pbxproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@
818818
TargetAttributes = {
819819
5E2646261FB64876002DC6B6 = {
820820
CreatedOnToolsVersion = 9.1;
821-
LastSwiftMigration = 1010;
821+
LastSwiftMigration = 1130;
822822
ProvisioningStyle = Automatic;
823823
};
824824
5E26462F1FB64876002DC6B6 = {
@@ -834,12 +834,12 @@
834834
};
835835
5EFE9197203F6DD700E21BAA = {
836836
CreatedOnToolsVersion = 9.3;
837-
LastSwiftMigration = 1010;
837+
LastSwiftMigration = 1130;
838838
ProvisioningStyle = Automatic;
839839
};
840840
5EFE91AF203F6E8D00E21BAA = {
841841
CreatedOnToolsVersion = 9.3;
842-
LastSwiftMigration = 1010;
842+
LastSwiftMigration = 1130;
843843
ProvisioningStyle = Automatic;
844844
};
845845
5EFE91CC203F6F6900E21BAA = {
@@ -1177,7 +1177,7 @@
11771177
MTL_ENABLE_DEBUG_INFO = YES;
11781178
SDKROOT = macosx;
11791179
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
1180-
SWIFT_VERSION = 4.2;
1180+
SWIFT_VERSION = 5.0;
11811181
};
11821182
name = Debug;
11831183
};
@@ -1225,7 +1225,7 @@
12251225
GCC_WARN_UNUSED_VARIABLE = YES;
12261226
MTL_ENABLE_DEBUG_INFO = NO;
12271227
SDKROOT = macosx;
1228-
SWIFT_VERSION = 4.2;
1228+
SWIFT_VERSION = 5.0;
12291229
};
12301230
name = Release;
12311231
};

PlaygroundLogger/PlaygroundLogger/LogEntry+Reflection.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ extension LogEntry.StructuredDisposition {
172172
self = .keyContainer
173173
case .set:
174174
self = .membershipContainer
175+
@unknown default:
176+
// If this is an unknown display style, default to .container.
177+
self = .container
175178
}
176179
}
177180
}
@@ -193,6 +196,9 @@ extension Mirror {
193196
return policy.aggregateChildPolicy
194197
case .optional, .collection, .dictionary, .set:
195198
return policy.containerChildPolicy
199+
@unknown default:
200+
// If this is an unknown display style, default to treating it like an aggregate.
201+
return policy.aggregateChildPolicy
196202
}
197203
}()
198204

@@ -205,6 +211,9 @@ extension Mirror {
205211
return currentDepth
206212
case .class, .struct, .tuple, .enum, .collection, .set:
207213
return currentDepth + 1
214+
@unknown default:
215+
// If this is an unknown display style, assume it consumes a level of depth.
216+
return currentDepth + 1
208217
}
209218
}()
210219

PlaygroundLogger/PlaygroundLoggerTests/LegacyPlaygroundLoggerTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,7 @@ enum PlaygroundRepresentation : UInt8, Hashable, CustomStringConvertible, Equata
830830
case .collection: self = .IndexContainer
831831
case .dictionary: self = .KeyContainer
832832
case .set: self = .MembershipContainer
833+
@unknown default: self = .Container
833834
}
834835
}
835836
}

0 commit comments

Comments
 (0)