@@ -171,6 +171,11 @@ func withSwiftObjectCanary<T>(
171
171
expectEqual ( 0 , swiftObjectCanaryCount, stackTrace: stackTrace)
172
172
}
173
173
174
+ // Hack to ensure the CustomReflectable conformance is used directly by the test
175
+ // in case it comes from a library that would otherwise not be autolinked.
176
+ @inline ( never)
177
+ func assertCustomReflectable< T: CustomReflectable > ( _ t: T ) { }
178
+
174
179
var Runtime = TestSuite ( " Runtime " )
175
180
176
181
func _isClassOrObjCExistential_Opaque< T> ( _ x: T . Type ) -> Bool {
@@ -614,7 +619,9 @@ Reflection.test("MetatypeMirror") {
614
619
615
620
Reflection . test ( " CGPoint " ) {
616
621
var output = " "
617
- dump ( CGPoint ( x: 1.25 , y: 2.75 ) , to: & output)
622
+ let point = CGPoint ( x: 1.25 , y: 2.75 )
623
+ assertCustomReflectable ( point)
624
+ dump ( point, to: & output)
618
625
619
626
let expected =
620
627
" ▿ (1.25, 2.75) \n " +
@@ -626,7 +633,9 @@ Reflection.test("CGPoint") {
626
633
627
634
Reflection . test ( " CGSize " ) {
628
635
var output = " "
629
- dump ( CGSize ( width: 1.25 , height: 2.75 ) , to: & output)
636
+ let size = CGSize ( width: 1.25 , height: 2.75 )
637
+ assertCustomReflectable ( size)
638
+ dump ( size, to: & output)
630
639
631
640
let expected =
632
641
" ▿ (1.25, 2.75) \n " +
@@ -638,11 +647,11 @@ Reflection.test("CGSize") {
638
647
639
648
Reflection . test ( " CGRect " ) {
640
649
var output = " "
641
- dump (
642
- CGRect (
643
- origin : CGPoint ( x : 1 .25, y : 2.25 ) ,
644
- size : CGSize ( width : 10.25 , height : 11.75 ) ) ,
645
- to: & output)
650
+ let rect = CGRect (
651
+ origin : CGPoint ( x : 1.25 , y : 2.25 ) ,
652
+ size : CGSize ( width : 10 .25, height : 11.75 ) )
653
+ assertCustomReflectable ( rect )
654
+ dump ( rect , to: & output)
646
655
647
656
let expected =
648
657
" ▿ (1.25, 2.25, 10.25, 11.75) \n " +
0 commit comments