File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
src/tests/Loader/classloader/generics/ByRefLike Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 73
73
74
74
.field public !T Field
75
75
76
+ .method public hidebysig
77
+ instance !T CreateDefaultInstance() cil managed
78
+ {
79
+ .locals init (
80
+ [0] !T
81
+ )
82
+ ldloca.s 0
83
+ initobj !T
84
+ ldloc.0
85
+ ret
86
+ }
87
+
88
+ .method public hidebysig
89
+ instance class [System.Runtime]System.Type GetGenericType() cil managed
90
+ {
91
+ ldtoken !T
92
+ call class [System.Runtime]System.Type [System.Runtime]System.Type::GetTypeFromHandle(valuetype [System.Runtime]System.RuntimeTypeHandle)
93
+ ret
94
+ }
95
+
76
96
.method public hidebysig
77
97
instance object BoxAsObject(!T) cil managed
78
98
{
564
584
ret
565
585
}
566
586
587
+ .method public hidebysig static
588
+ string CreateDefaultInstance() cil managed
589
+ {
590
+ .locals init (
591
+ [0] valuetype InvalidCSharp.GenericByRefLike_Over`1<valuetype ByRefLikeType>
592
+ )
593
+
594
+ ldloca.s 0
595
+ initobj valuetype InvalidCSharp.GenericByRefLike_Over`1<valuetype ByRefLikeType>
596
+ ldloca.s 0
597
+ call instance !0 valuetype InvalidCSharp.GenericByRefLike_Over`1<valuetype ByRefLikeType>::CreateDefaultInstance()
598
+ pop
599
+ ldloca.s 0
600
+ call instance class [System.Runtime]System.Type valuetype InvalidCSharp.GenericByRefLike_Over`1<valuetype ByRefLikeType>::GetGenericType()
601
+ callvirt instance string [System.Runtime]System.Object::ToString()
602
+ ret
603
+ }
604
+
567
605
.method public hidebysig static
568
606
object BoxAsObject() cil managed
569
607
{
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ public static void Validate_TypeLoad()
21
21
Console . WriteLine ( $ " -- Instantiate: { Exec . GenericValueType ( ) } ") ;
22
22
Console . WriteLine ( $ " -- Instantiate: { Exec . GenericByRefLike ( ) } ") ;
23
23
Console . WriteLine ( $ " -- Instantiate: { Exec . GenericByRefLike_ConstraintsAreIndependent_Int32_Int32 ( ) } ") ;
24
+ Console . WriteLine ( $ " -- Create: { Exec . CreateDefaultInstance ( ) } ") ;
24
25
25
26
Assert . Throws < TypeLoadException > ( ( ) => { Exec . GenericClass_Invalid ( ) ; } ) ;
26
27
Assert . Throws < TypeLoadException > ( ( ) => { Exec . GenericInterface_Invalid ( ) ; } ) ;
You can’t perform that action at this time.
0 commit comments