Module printing and serialization support for @unchecked Sendable

This commit is contained in:
Doug Gregor
2021-07-11 12:29:21 -07:00
parent 29f5d7a64a
commit 06bbc70b3e
31 changed files with 270 additions and 253 deletions

View File

@@ -34,35 +34,26 @@ public extension MyActor {
// CHECK-NEXT: #endif
public func globalAsync() async { }
// CHECK: #if compiler(>=5.3) && $MarkerProtocol
// CHECK-NEXT: public protocol MP {
// CHECK: @_marker public protocol MP {
// CHECK-NEXT: }
// CHECK-NEXT: #else
// CHECK-NEXT: public typealias MP = Any
// CHECK-NEXT: #endif
@_marker public protocol MP { }
// CHECK: #if compiler(>=5.3) && $MarkerProtocol
// CHECK-NEXT: @_marker public protocol MP2 : FeatureTest.MP {
// CHECK: @_marker public protocol MP2 : FeatureTest.MP {
// CHECK-NEXT: }
// CHECK-NEXT: #else
// CHECK-NEXT: public typealias MP2 = Any
// CHECK-NEXT: #endif
@_marker public protocol MP2: MP { }
// CHECK: #if compiler(>=5.3) && $MarkerProtocol
// CHECK-NEXT: public protocol MP3 : AnyObject, FeatureTest.MP {
// CHECK-NOT: #if compiler(>=5.3) && $MarkerProtocol
// CHECK: public protocol MP3 : AnyObject, FeatureTest.MP {
// CHECK-NEXT: }
public protocol MP3: AnyObject, MP { }
// CHECK: #if compiler(>=5.3) && $MarkerProtocol
// CHECK-NEXT: extension FeatureTest.MP2 {
// CHECK: extension FeatureTest.MP2 {
// CHECK-NEXT: func inMP2
extension MP2 {
public func inMP2() { }
}
// CHECK: class OldSchool {
// CHECK: class OldSchool : FeatureTest.MP {
public class OldSchool: MP {
// CHECK: #if compiler(>=5.3) && $AsyncAwait
// CHECK-NEXT: takeClass()
@@ -70,7 +61,7 @@ public class OldSchool: MP {
public func takeClass() async { }
}
// CHECK: class OldSchool2 {
// CHECK: class OldSchool2 : FeatureTest.MP {
public class OldSchool2: MP {
// CHECK: #if compiler(>=5.3) && $AsyncAwait
// CHECK-NEXT: takeClass()
@@ -113,13 +104,13 @@ public struct IsRP: RP {
// CHECK-NEXT: public func acceptsRP
public func acceptsRP<T: RP>(_: T) { }
// CHECK: #if compiler(>=5.3) && $MarkerProtocol
// CHECK-NEXT: extension Swift.Array : FeatureTest.MP where Element : FeatureTest.MP {
// CHECK-NOT: #if compiler(>=5.3) && $MarkerProtocol
// CHECK: extension Swift.Array : FeatureTest.MP where Element : FeatureTest.MP {
extension Array: FeatureTest.MP where Element : FeatureTest.MP { }
// CHECK: }
// CHECK: #if compiler(>=5.3) && $MarkerProtocol
// CHECK-NEXT: extension FeatureTest.OldSchool : Swift.UnsafeSendable {
// CHECK-NOT: #if compiler(>=5.3) && $MarkerProtocol
// CHECK: extension FeatureTest.OldSchool : Swift.UnsafeSendable {
extension OldSchool: UnsafeSendable { }
// CHECK-NEXT: }
@@ -152,8 +143,3 @@ public func stage(with actor: MyActor) { }
public func asyncIsh(@_inheritActorContext operation: @Sendable @escaping () async -> Void) { }
// CHECK-NOT: extension FeatureTest.MyActor : Swift.Sendable
// CHECK: #if compiler(>=5.3) && $MarkerProtocol
// CHECK-NEXT: extension FeatureTest.OldSchool : FeatureTest.MP {
// CHECK-NEXT: #endif