@@ -25,11 +25,15 @@ public func takeGenericPair<T, T1>(_ x: GenericPair<T, T1>) {
25
25
print ( x)
26
26
}
27
27
28
+ public func passThroughGenericPair< T1, T> ( _ x: GenericPair < T1 , T > , _ y: T ) -> GenericPair < T1 , T > {
29
+ return GenericPair < T1 , T > ( x: x. x, y: y)
30
+ }
31
+
28
32
// CHECK: template<class T_0_0, class T_0_1>
29
33
// CHECK-NEXT: requires swift::isUsableInGenericContext<T_0_0> && swift::isUsableInGenericContext<T_0_1>
30
34
// CHECK-NEXT: class _impl_GenericPair;
31
35
// CHECK-EMPTY:
32
- // CHECK-NEXT: static_assert(2 <= 3, "unsupported generic requirement list for metadata func");
36
+ // CHECK-NEXT: static_assert(2 <= 3, "unsupported generic requirement list for metadata func");
33
37
// CHECK-NEXT: // Type metadata accessor for GenericPair
34
38
// CHECK-NEXT: SWIFT_EXTERN swift::_impl::MetadataResponseTy $s8Generics11GenericPairVMa(swift::_impl::MetadataRequestTy, void * _Nonnull, void * _Nonnull) SWIFT_NOEXCEPT SWIFT_CALL;
35
39
@@ -69,6 +73,14 @@ public func takeGenericPair<T, T1>(_ x: GenericPair<T, T1>) {
69
73
// CHECK-NEXT: });
70
74
// CHECK-NEXT: }
71
75
76
+ // CHECK: template<class T1, class T>
77
+ // CHECK-NEXT: requires swift::isUsableInGenericContext<T1> && swift::isUsableInGenericContext<T>
78
+ // CHECK-NEXT: inline GenericPair<T1, T> passThroughGenericPair(const GenericPair<T1, T>& x, const T & y) noexcept SWIFT_WARN_UNUSED_RESULT {
79
+ // CHECK-NEXT: return _impl::_impl_GenericPair<T1, T>::returnNewValue([&](void * _Nonnull result) {
80
+ // CHECK-NEXT: _impl::$s8Generics22passThroughGenericPairyAA0dE0Vyxq_GAE_q_tr0_lF(result, _impl::_impl_GenericPair<T1, T>::getOpaquePointer(x), swift::_impl::getOpaquePointer(y), swift::getTypeMetadata<T1>(), swift::getTypeMetadata<T>());
81
+ // CHECK-NEXT: });
82
+ // CHECK-NEXT: }
83
+
72
84
// CHECK: template<class T, class T1>
73
85
// CHECK-NEXT: requires swift::isUsableInGenericContext<T> && swift::isUsableInGenericContext<T1>
74
86
// CHECK-NEXT: inline void takeGenericPair(const GenericPair<T, T1>& x) noexcept {
0 commit comments