@@ -157,16 +157,16 @@ extension Test {
157157 ///
158158 /// - Warning: This function is used to implement the `@Test` macro. Do not
159159 /// call it directly.
160- public static func __function(
160+ public static func __function< S > (
161161 named testFunctionName: String ,
162- in containingType: ( any ~ Copyable . Type) ? ,
162+ in containingType: S . Type ? ,
163163 xcTestCompatibleSelector: __XCTestCompatibleSelector ? ,
164164 displayName: String ? = nil ,
165165 traits: [ any TestTrait ] ,
166166 sourceLocation: SourceLocation ,
167167 parameters: [ __Parameter ] = [ ] ,
168168 testFunction: @escaping @Sendable ( ) async throws -> Void
169- ) -> Self {
169+ ) -> Self where S : ~ Copyable {
170170 // Don't use Optional.map here due to a miscompile/crash. Expand out to an
171171 // if expression instead. SEE: rdar://134280902
172172 let containingTypeInfo : TypeInfo ? = if let containingType {
@@ -241,17 +241,17 @@ extension Test {
241241 ///
242242 /// - Warning: This function is used to implement the `@Test` macro. Do not
243243 /// call it directly.
244- public static func __function< C> (
244+ public static func __function< S , C> (
245245 named testFunctionName: String ,
246- in containingType: ( any ~ Copyable . Type) ? ,
246+ in containingType: S . Type ? ,
247247 xcTestCompatibleSelector: __XCTestCompatibleSelector ? ,
248248 displayName: String ? = nil ,
249249 traits: [ any TestTrait ] ,
250250 arguments collection: @escaping @Sendable ( ) async throws -> C ,
251251 sourceLocation: SourceLocation ,
252252 parameters paramTuples: [ __Parameter ] ,
253253 testFunction: @escaping @Sendable ( C . Element) async throws -> Void
254- ) -> Self where C: Collection & Sendable , C. Element: Sendable {
254+ ) -> Self where S : ~ Copyable , C: Collection & Sendable , C. Element: Sendable {
255255 let containingTypeInfo : TypeInfo ? = if let containingType {
256256 TypeInfo ( describing: containingType)
257257 } else {
@@ -388,17 +388,17 @@ extension Test {
388388 ///
389389 /// - Warning: This function is used to implement the `@Test` macro. Do not
390390 /// call it directly.
391- public static func __function< C1, C2> (
391+ public static func __function< S , C1, C2> (
392392 named testFunctionName: String ,
393- in containingType: ( any ~ Copyable . Type) ? ,
393+ in containingType: S . Type ? ,
394394 xcTestCompatibleSelector: __XCTestCompatibleSelector ? ,
395395 displayName: String ? = nil ,
396396 traits: [ any TestTrait ] ,
397397 arguments collection1: @escaping @Sendable ( ) async throws -> C1 , _ collection2: @escaping @Sendable ( ) async throws -> C2 ,
398398 sourceLocation: SourceLocation ,
399399 parameters paramTuples: [ __Parameter ] ,
400400 testFunction: @escaping @Sendable ( C1 . Element, C2 . Element) async throws -> Void
401- ) -> Self where C1: Collection & Sendable , C1. Element: Sendable , C2: Collection & Sendable , C2. Element: Sendable {
401+ ) -> Self where S : ~ Copyable , C1 : Collection & Sendable , C1. Element: Sendable , C2: Collection & Sendable , C2. Element: Sendable {
402402 let containingTypeInfo : TypeInfo ? = if let containingType {
403403 TypeInfo ( describing: containingType)
404404 } else {
@@ -416,17 +416,17 @@ extension Test {
416416 ///
417417 /// - Warning: This function is used to implement the `@Test` macro. Do not
418418 /// call it directly.
419- public static func __function< C, E1, E2> (
419+ public static func __function< S , C, E1, E2> (
420420 named testFunctionName: String ,
421- in containingType: ( any ~ Copyable . Type) ? ,
421+ in containingType: S . Type ? ,
422422 xcTestCompatibleSelector: __XCTestCompatibleSelector ? ,
423423 displayName: String ? = nil ,
424424 traits: [ any TestTrait ] ,
425425 arguments collection: @escaping @Sendable ( ) async throws -> C ,
426426 sourceLocation: SourceLocation ,
427427 parameters paramTuples: [ __Parameter ] ,
428428 testFunction: @escaping @Sendable ( ( E1, E2) ) async throws -> Void
429- ) -> Self where C: Collection & Sendable , C. Element == ( E1 , E2 ) , E1: Sendable , E2: Sendable {
429+ ) -> Self where S : ~ Copyable , C: Collection & Sendable , C. Element == ( E1 , E2 ) , E1: Sendable , E2: Sendable {
430430 let containingTypeInfo : TypeInfo ? = if let containingType {
431431 TypeInfo ( describing: containingType)
432432 } else {
@@ -447,17 +447,17 @@ extension Test {
447447 ///
448448 /// - Warning: This function is used to implement the `@Test` macro. Do not
449449 /// call it directly.
450- public static func __function< Key, Value> (
450+ public static func __function< S , Key, Value> (
451451 named testFunctionName: String ,
452- in containingType: ( any ~ Copyable . Type) ? ,
452+ in containingType: S . Type ? ,
453453 xcTestCompatibleSelector: __XCTestCompatibleSelector ? ,
454454 displayName: String ? = nil ,
455455 traits: [ any TestTrait ] ,
456456 arguments dictionary: @escaping @Sendable ( ) async throws -> Dictionary < Key , Value > ,
457457 sourceLocation: SourceLocation ,
458458 parameters paramTuples: [ __Parameter ] ,
459459 testFunction: @escaping @Sendable ( ( Key, Value) ) async throws -> Void
460- ) -> Self where Key: Sendable , Value: Sendable {
460+ ) -> Self where S : ~ Copyable , Key: Sendable , Value: Sendable {
461461 let containingTypeInfo : TypeInfo ? = if let containingType {
462462 TypeInfo ( describing: containingType)
463463 } else {
@@ -472,17 +472,17 @@ extension Test {
472472 ///
473473 /// - Warning: This function is used to implement the `@Test` macro. Do not
474474 /// call it directly.
475- public static func __function< C1, C2> (
475+ public static func __function< S , C1, C2> (
476476 named testFunctionName: String ,
477- in containingType: ( any ~ Copyable . Type) ? ,
477+ in containingType: S . Type ? ,
478478 xcTestCompatibleSelector: __XCTestCompatibleSelector ? ,
479479 displayName: String ? = nil ,
480480 traits: [ any TestTrait ] ,
481481 arguments zippedCollections: @escaping @Sendable ( ) async throws -> Zip2Sequence < C1 , C2 > ,
482482 sourceLocation: SourceLocation ,
483483 parameters paramTuples: [ __Parameter ] ,
484484 testFunction: @escaping @Sendable ( C1 . Element, C2 . Element) async throws -> Void
485- ) -> Self where C1: Collection & Sendable , C1. Element: Sendable , C2: Collection & Sendable , C2. Element: Sendable {
485+ ) -> Self where S : ~ Copyable , C1 : Collection & Sendable , C1. Element: Sendable , C2: Collection & Sendable , C2. Element: Sendable {
486486 let containingTypeInfo : TypeInfo ? = if let containingType {
487487 TypeInfo ( describing: containingType)
488488 } else {
@@ -556,7 +556,7 @@ extension Test {
556556///
557557/// - Warning: This function is used to implement the `@Test` macro. Do not use
558558/// it directly.
559- @unsafe @inlinable public func __requiringUnsafe< T> ( _ value: consuming T ) throws -> T where T: ~ Copyable {
559+ @unsafe @inlinable public func __requiringUnsafe< T> ( _ value: consuming T ) -> T where T: ~ Copyable {
560560 value
561561}
562562
0 commit comments