Skip to content

[PlaygroundLogger] Migrated PlaygroundLogger and its tests to Swift 5. #44

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

Merged
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
10 changes: 5 additions & 5 deletions PlaygroundLogger/PlaygroundLogger.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@
TargetAttributes = {
5E2646261FB64876002DC6B6 = {
CreatedOnToolsVersion = 9.1;
LastSwiftMigration = 1010;
LastSwiftMigration = 1130;
ProvisioningStyle = Automatic;
};
5E26462F1FB64876002DC6B6 = {
Expand All @@ -834,12 +834,12 @@
};
5EFE9197203F6DD700E21BAA = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1010;
LastSwiftMigration = 1130;
ProvisioningStyle = Automatic;
};
5EFE91AF203F6E8D00E21BAA = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1010;
LastSwiftMigration = 1130;
ProvisioningStyle = Automatic;
};
5EFE91CC203F6F6900E21BAA = {
Expand Down Expand Up @@ -1177,7 +1177,7 @@
MTL_ENABLE_DEBUG_INFO = YES;
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand Down Expand Up @@ -1225,7 +1225,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
9 changes: 9 additions & 0 deletions PlaygroundLogger/PlaygroundLogger/LogEntry+Reflection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ extension LogEntry.StructuredDisposition {
self = .keyContainer
case .set:
self = .membershipContainer
@unknown default:
// If this is an unknown display style, default to .container.
self = .container
}
}
}
Expand All @@ -193,6 +196,9 @@ extension Mirror {
return policy.aggregateChildPolicy
case .optional, .collection, .dictionary, .set:
return policy.containerChildPolicy
@unknown default:
// If this is an unknown display style, default to treating it like an aggregate.
return policy.aggregateChildPolicy
}
}()

Expand All @@ -205,6 +211,9 @@ extension Mirror {
return currentDepth
case .class, .struct, .tuple, .enum, .collection, .set:
return currentDepth + 1
@unknown default:
// If this is an unknown display style, assume it consumes a level of depth.
return currentDepth + 1
}
}()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ enum PlaygroundRepresentation : UInt8, Hashable, CustomStringConvertible, Equata
case .collection: self = .IndexContainer
case .dictionary: self = .KeyContainer
case .set: self = .MembershipContainer
@unknown default: self = .Container
}
}
}
Expand Down